I wonder how important the ritualistic effects end up being. If you get in trouble, for presumably large classes of trouble, you face detention. That's better than suspension or expulsion or something else that could have far-reaching impact. That people then actually show up for detention is also quite remarkable, especially if the threat of missing it or not doing the numbers is just...more detention. The waste of time reinforces the idea of "doing the time" for your crime, afterwards things are square again, like a ritual cleansing. It lets you know you can make mistakes bad enough to get detention, repeatedly even, but you can still come out of it ok in the end.
Don't understand the shorts thing in winter though.
I always thought these kinds of busywork are completely useless, and don't do anything to stop you from getting into trouble again, they never did for me at least.
There's always been an element of sadism in commonwealth country's schooling systems. We had to wear shorts to school until 5th form, even in winter when it hit sub zero temperatures (at least it didn't snow).
At least they got rid of the privilege of prefects being able to hand out detentions after the entire school collectively told them to fuck off.
As someone who has issues with authority, high school was a very difficult time for me.