It's interesting you would choose this example...I was actually thinking of using it myself, but in a different context.
To answer your questions: Of course the students are allowed to comment, and the girl probably could have avoided the slut accusation by dressing differently. Does that make it appropriate to call her a slut? In this situation, I don't believe so.
There are tactful, dignified ways to express moral disapproval of something. This is especially true when the behavior being protested doesn't directly harm or threaten anyone else. So if I were a teacher and I heard a student call Ms. Spears a slut, I wouldn't have the namecaller suspended...but I would have a talk with her about the proper way to express yourself. I would also have a talk with Ms. Spears, except for the fact that I'd have a sexual harassment suit on my hands for doing so.
Just out of curiousity, suppose a student was wearing a regular tank top on a summer day, nothing too revealing. A Muslim student approaches her, holds out a sweater, and says "You better put this on, you dirty slut!" As a teacher, would you take a hands-off approach to this act of social boundary-setting?
What would I do? I'll add to your story that she felt threatened. I would give the guys their sweater back and tell them to leave her alone or get expelled, then I would loan her my sweater. I would tell them that while being a slut is a moral wrong, wearing a tank-top doesn't make her a slut.
My niece was teased mercilessly in middle school because she had unusually long legs. Everyone called her Big Bird and she was quite upset about it. It was sad, but really there is not much you can do. It's a tough age and kids have opinions about things. Clothes are easy. Just wear something different. There was nothing she could do about the length of her legs.
BTW, the rest of her body grew to match those legs and all those boys who teased her wanted to date her a few years later.