Correction appended, March 27

In my junior year of high school I wore leggings to my AP Latin class. Leggings were against dress code at my school, as were sweatpants and skirts that were shorter than the ends of your fingertips. I had my leggings on under a dress, which admittedly probably didn’t pass the fingertip rule. My female teacher admonished me in front of the class before sending me home to change. She said something about how I wasn’t respecting myself. I ran home crying and changed into jeans. When I returned, one of the older boys in my class made a rude comment as I sunk into my seat.

I broke school rules—as just about every other teenage girl in high school did when they got dressed in the morning—and probably deserved to be punished. But this time, my teacher, tired of reprimanding girls for dress code violations every day, had decided to make an example of me in front of the class. The result? I missed important test prep for my upcoming AP exam, and she gave some immature boys an excuse to make sexual remarks in a classroom setting. They weren’t punished. That teacher was walking the fine line between enforcing a dress code and slut shaming.

This week, a group of middle-school girls in Evanston, Illinois picketed their school for the right to wear leggings. The girls at Haven Middle School had been told, like I had, that leggings were “too distracting to boys” to wear to school, according to 13-year-old Sophie Hasty who was quoted in the Evanston Review. Hasty makes the sophisticated argument that “not being able to wear leggings because it’s ‘too distracting for boys’ is giving us the impression we should be guilty for what guys do.” Five hundred students signed their petition, and a group of girls wearing leggings and yoga pants (also banned) protested outside the school last week with signs saying, “Are my pants lowering your test scores?”

The argument being made by school administrators is not that distant from the arguments made by those who accuse rape victims of asking to be assaulted by dressing a certain way. We tell women to cover themselves from the male gaze, but we neglect to tell the boys to look at something else. That this has a sexist undertone is demonstrated by the fact that the girls who had more curves to show off were the ones more often disciplined. “Students who were getting ‘dress-coded,’ or disciplined for their attire, tended to be girls who were more developed,” Juliet Bond, a parent of a student at Haven, told the Evanston Review.

Lucy Shapiro, a 12-year-old at Haven, added that when both she and a friend wore the same type of athletic shorts, a teacher disciplined her but not her friend because, she was told, “I had a different body type than my friend…With all the social expectations of being a girl, it’s already hard enough to pick an outfit without adding in the dress code factor.”

“For me, it’s about shaming girls about their bodies,” Bond said. “It’s this message across genders that girls have to cover up, and teachers saying to girls, the reason for this rule is so that boys aren’t distracted.”

The dress code in a middle school in Evanston is far from an isolated incident. In April of 2013, a New Jersey middle school banned girls from wearing strapless dresses to prom because they were “distracting,” but later compromised and allowed one strap dresses after parents protested. A high school principal in Minnesota emailed parents asking them to forbid their children from wearing leggings to school because their “backsides” were “too closely defined” and therefore “highly distracting.” A kindergartner in Georgia was asked to change her short skirt because it was a “distraction to the other students,” which begs the question, were kindergarten boys lusting after their peer during coloring time?

Are uniforms the answer? Many teens (including myself when I was in high school) would argue that a uniform would prevent them from expressing their identity through their clothing when forging their individuality in middle school and high school is hard enough. And sometimes schools can take uniformity too far, as with the girl in Colorado who was banned from classes this week after shaving her head to support a friend going through chemotherapy: she was told she violated dress code. Could the answer be single-sex schools? Distractions from the other sex are a key reason many parents opt into same-sex education for their developing teens. But other parents value a co-educational experience and some even argue it’s essential in teaching girls how to lean in early and be competitive with their male peers in class.

In the end, what’s disruptive in the classrooms is not the clothing that girls are wearing but their bodies themselves. I’m sure teachers mean well by encouraging girls not to think that they need to wear tight clothes in order to get attention from boys or emulate their favorite TV show characters. But by implying that boys simply can’t control themselves around girls’ bodies, administrators are pandering to a culture that too often transfers blame from men to their female victims. They risk encouraging young, impressionable minds—both male and female—to think that women are in some way responsible because of their “suggestive” clothing and their behavior for sexual crimes and transgressions, rather than making clear that each individual is responsible for his or her own actions.

Some clothes are appropriate for school and some are not. But we ought to make that distinction without implying that a girl must be accountable for the sexual attention she gets. Take sex out of the equation. Don’t use the word “distracting” when explaining the rules to girls. Enforce the code equally between the genders. Tell students that the dress code is meant to show respect to learning and school; conforming to the rules is not a measure of how much a student respects herself. And use encouraging language because no teacher should tell a kid how to respect his or her own body.

Correction: The original version of this story, using information from the Evanston Review, misstated Juliet Bond’s first name.

Write to Eliana Dockterman at eliana.dockterman@time.com.