As opposed as I am to uniforms and strict dress codes (and find enforcing them to be a general pain in the butt), I also have found that certain clothing can be distracting. I teach middle school and some of these children show WAY TOO MUCH cleavage. As I write this, I am thinking of one young lady hunched over her book and the boys in class falling out of their desks gawking as they stared at her ample endowments. The only learning happening in this moment is less about academics and more about hormones.
I would never publicly humiliate a child for what he/she wore, but appropriate clothing is necessary. Parents should especially be accountable for what they allow their children to purchase and wear. My mother would never have let me buy, let alone wear a tank top that said "I f***ed your boyfriend", yet, I recall a seventh grader showing up in school in that get up. (The shirt had the words written out, but hubpages won't let me spell it out...lol) It is frustrating to see a child dressed inappropriately, but then when you meet the parent who dresses the same or is unaware or nonchalant about their children's wardrobe, it is easy to understand that appropriate clothing is not a priority at home.
At my school, the teachers have a dress code as well as the students, but there are a few who don't follow the code and there are negligible consequences. Our students out of dress code have to report to the office to receive substitute clothing, but they change out of the more appropriate clothing within 2-3 hours or classes. It is a battle that is wearying, but I personally do not want to see butts, bellies, and boobs and I don't think middle school children should be showing the 3 Bs.
When they are old enough to make wise, informed decisions on their sexuality and to be consenting adults, then they can dress how they see fit, but in the classroom, they need to be appropriate, and while underage, they need to not send the signal of sex. (Digressing a bit, I know....)