As a high school teacher of 22 years, let me explain how this works--and what to do about it.
First, schools have the legal right to create dress codes or even force students to wear uniforms. The Supreme Court has ruled, it's law, and that's the way it is. Read Tinker v. Des Moines Independent School District for full details, or look here: http://education.findlaw.com/student-
Second, school dress codes are written to set a basic standard of appropriateness. The school board decides, based on community standards, what is and is not appropriate for students to wear in school. This isn't new, it's not strange or bad. There are certain outfits and articles of clothing that are inappropriate for school, just like there are inappropriate outfits for worship services, a funeral, a wedding, or a job. My youngest son recently applied for a job, for example, and he was handed an extremely strict dress code. Our entire society dictates what you can wear and when. Schools are no different. Dress codes are NOT written to body shame girls or to stop girls from wearing clothes that will "distract boys." I'm not sure where this idea got started.
Proper dress codes, such as the one in the district where I teach, spell out what clothes are allowed and which are not. My district does not allow spaghetti straps, sleeveless shirts, off-shoulder shirts, visible underwear, "muscle" shirts, tank tops, or shorts above a certain length. The sex of the wearer is irrelevant. Both boys and girls cannot wear tank tops or short shorts. If a boy showed up in spaghetti straps, he'd be sent home, though he'd be allowed to wear a skirt that came down to at least his fingertips. A school that DOES mention girls not being allowed to wear Thing A and boys not being allowed to wear Thing B is asking for trouble and needs to change its code to focus on the clothes and not the wearer.
Third, students are not allowed to use clothes to "express themselves" and "be comfortable." I'm not sure where that idea got started, either. A student's primary job at school is to learn, and anything that interferes with that job must be removed. The Supreme Court has also ruled on this (see Tinker above). A school may, at its discretion, allow a certain amount of self-expression, but this is solely the district's choice, and not the student's. That's the way it is, and you won't have much luck in changing a Supreme Court ruling. Save your energy.
Fourth, it's absolutely true that dress codes are often enforced unevenly. That's just the nature of the animal. This is because the main enforcers are teachers, and teachers are wildly different as people, and circumstances vary from class to class. Here's what happens:
Linda wears an inappropriate outfit to first hour. The teacher notices, but doesn't see enforcing the dress code as important, so she lets it go. Linda's second hour has 37 students in it. Linda slips into class and sits down while the teacher is dealing with 42 other problems, and the teacher doesn't even notice the outfit because he's so busy. Linda's third hour teacher notices the outfit, but also notes that Linda only comes to class one day in four, and if he sends her out, she'll miss today, too, and he'd rather have her stay in class, so he says nothing. Linda's fourth hour is gym, and she changes clothes for that one. Linda's fifth hour has a sub who doesn't understand the dress code and says nothing. Linda's sixth hour teacher says, "Your outfit isn't appropriate. You'll have to go down to the office and change or go home." "That's not fair! I've been wearing it all day!" Linda protests.
So yes, the codes aren't always enforced fairly. Such is life. If you want to ensure the codes are fairly enforced, you could volunteer to the district to be a dress code monitor. Call today!
What do you do if you run into dress code problems with your student?
First, per-emptively make sure your student has a selection of appropriate clothes. Teenagers push back, yes. Welcome to parenthood. Your job is to be a mom or dad, not a best friend. Remove inappropriate clothes from their wardrobe. Also be aware that even well-behaved teens will sometimes rebel, and a common tactic is to change clothes at school. If this happens and your student gets in trouble with the office, let them deal with it without support from you. Don't leave work to rush over with a new outfit. Let them wear the ugly set of school sweats all day or sit in the office until the end of school. It's a learning experience.
Second, understand that posting a rant on Facebook or Instagram about your daughter being "body-shamed" isn't anything but a bid for attention. You're just fishing for people to say how wronged you were and how lovely your daughter is, and you're secretly hoping the district will get deluged with emails or phone calls so they'll make changes without any work from you. The district won't cave to random phone calls and emails from strangers outside the district. Experienced administrators know that all they have to do is wait a week, and the outrage will die down. Nothing will change, though you may have duped a few more people into following you on Instagram, and it's pretty shitty to drag the school into your scheme.
Finally, if you think the dress code is unfair, get a group of like-minded parents together and talk to the school board. (Not the principal--the principal generally has no control over the dress code.) Going in a group will give you more clout. Outline what changes you think should be made, without yelling. If the code mentions the gender of the student, lobby to have it reworded to focus on the clothing instead. Have a list of reasons. Avoid things like "she needs to feel comfortable" or "he wants to express himself." Those won't go far. Instead, focus on things like, "These clothes are acceptable in our community," and "This is accepted public dress around here."
We have dress codes at work, in worship, and yes, in school. Having them in school gets students ready for dealing with them in adult life. They aren't going away, though you can have an impact on them if you do it right.