Ex wouldn't bring son pants

Me and my ex have joint custody of our 2 kids. My son's middle school called me at work. I work in surgery so I missed it. By the time I got out of surgery it was time to pick him up from school. The school called me because my son had an "accident" at school. What happened is he is lactose intolerant and has IBS. He still eats dairy though. During lunch he ate multiple slices of cheese pizza because he missed breakfast. He tried to go to the bathroom but the bathroom on 8th grade hall was shut down because it flooded so he tried to go to 7th grade hall but didn't make it. The school wanted me to bring him more pants. When I picked him up he was in sweat pants. They called my ex because they couldn't get ahold of me and he told the nurse his punishment can be to sit in that for eating that much dairy and refused to bring him pants so he had to take sweats from the lost and found. He went and cried in his room because he was embarrassed by the whole day and I called their dad because I found what he did crappy. He just said he can suck it up and stop being such a baby and if it was up to him he wouldn't even get lost and found clothes. I feel like his dad is such an ass.

Edit: This isn't something that has ever happened before which is why we've never brought him extra clothes. I will probably start now though