If you spent some time being part of about 50 adults who are in charge of, and responsible for, 2000+ students (everything from gangstas to corporate exectutives' kids), I think you might reverse the order of which is more stupid.
High school especially is the place where "the slippery slope" is not a fallacy. A certain percentage of the kids push the limits of acceptability on a daily basis, to see how much they can get away with.
I've seen girls come in wearing sheer blouses or skirts with highly visible underwear underneath. Guys come in with shirts emblazoned with "YOU SUCK!" or worse, on the front (these guys make a point of moving to the front seat of a class for the occasion). Hats, headbands, shoestrings, rags are indeed used as gang symbols which are then used to deliberately incite the "other guys."
We had a no hat rule instilled a few years ago, and so the gangstas (and the wannabes) would carry them in their hands. I was teaching a "foundations" class two years ago, when there was a thump at the window by the door. A red hat was pressed to the glass whereupon one of my students jumped up and ran to the door yelling "M*****F******N*****" etc.
At the other end of the scale, there are the "precious darlings" I get in the honors classes who are working on their lingerie modeling career. I have to look at these people, and if looking toward one side of a class means I have to see a 5/7th exposed breast, that does affect how I teach. I would say something like " that's not appropriate for school." Her: "What's not appropriate?" (forcing me to say it, you see?) About once a year I get the line: "well why are you staring at me there?"
A dress code is absolutely necessary. A line must be drawn in the sand. No, not sand, the line is on the iciest and steepest of slippery slopes.