First of all, I'm not talking about it as a legal matter, I couldn't care less about legal precedents regarding school dress codes. I'm saying as a moral matter, the school here is doing something wrong, and she was totally right in protesting it.
As for your skateboard example, that's an entirely different issue. What you did was harmful and dangerous, and the rules against it are entirely sensible. Riding a skateboard down a hallway and jumping out of windows are safety hazards and it is totally fine that a school prohibits it.
You're making a straw man of my argument here: no where did I say that there should be no rules whatsoever, I said that this particular rule is idiotic and harmful, and good on her for protesting it.
If the primary goal of a school is to educate and bring up students in the best way possible, there should be rules, but the rules have to be sensible. If the rules are nonsensical, arbitrary or harmful, the only things they will teach students is to either be rebellious and never follow rules, or it will teach them to feel shameful for accidentally violating arbitrary fiats by people in authority. Both outcomes run entirely counter to what schools should be doing.
As for banning risqué clothing, that's certainly valid in some cases. Girls shouldn't be walking around in bikinis and boys shouldn't be walking around in their underwear. But the ultimate point of these dress codes have to be to teach the students what kind of dress is appropriate in public settings, not to shame students for their bodies. And the point here is that leggings are not risqué! It's a perfectly normal piece of apparel that many people wear to all sorts of places.
And as for this comment:
Are you serious? Western culture, and American culture in particular, is hugely and massively discouraging of girls being sexual creatures. It praises girls who are virgins and shames girls who have sex by calling them "sluts" and "whores". You may not accept this, but I assure: it's absolutely true. Schools are an especially toxic environment for this. Boys who have sex are praised as "players" by their peer groups, but girls who do it are excluded, shamed and bullied.
As a culture, we're fine with seeing images of women in sexual contexts and we're fine with men viewing them, but what we're not nearly as accepting of the women who actually do it. Those women we look down on.