This is one of those rare times when I must strongly disagree with CoogansBluff.
The team used the gym. It's unreasonable to suggest that they should never take part in cleaning it. My daughter often helps when I'm cleaning up our local park, even on days when she doesn't play or practice. There are a small handful of girls who also help keep the park clean. The majority of players and their parents, however, do not. It's someone else's job.
Not everything that happens related to sports is about excelling in sports. Whether you want to admit it or not, there can be great value in stepping into the shoes of another. If you don't believe that children can benefit from doing so, then maybe a reconsideration of who has the low opinion of them is in order.
I don't think we disagree, at least not strongly.
If they were cleaning the gym because it needed cleaning, then it's very reasonable that they help clean it, as you said. It's like getting players involved in taking care of the softball field. It teaches responsibility and appreciation. Just not sure how it is helpful to use it as punishment. My daughter has chores, but they aren't punishment.
We don't know the coach's intent in this case, so I again need to state that my opinions are about shame and punishment in general and not the incident that started the discussion. What this coach did might've been appropriate. I don't know the context or the relationship he has with his players.