Failure to teach children the difference between true, objective right & wrong (from God) and the fallible man-made version borders on child abuse. Those who say "rules are rules" without regard to the legitimacy of those rules wallow in moral relativism, without even knowing it.
As for who sets the limits, apparently the rule was established by the school through its normal process. In short, this means the local society established it. This isn't some arbitrary rule leveled in an arbitrary way.
I teach my children that they must follow the rules. In fact we go over the rules sent home very carefully one by one when the enter a new school. We have even objected at the outset that some rules were either too stupid to agree to or requested clarification. The result has normally been a rewritten rule or an acceptance by the school that we will be exempted. If they want to change them, fine. Follow them until the change is made.
I had one child break a rule that I myself would have been guilty of. There was wet cement and he wrote his name in it. He was suspended for 3 days for damaging property. I did all I could do to keep from bursting out laughing when I was called to principals office. He broke the rule and he paid the price and I supported the punishment. Ten years latter his name is still there and he still thinks the punishment was worth it and that he deserved it.