You're talking to your friends, and you say "fuck". Okay, that's nice. If your friends didn't like the language, they wouldn't be hanging out with you. You're talking to your friends, and you say "fuck" loud enough to be heard a hundred feet away, in a school where this is against the rules and you know it is against the rules. At least a couple dozen people hear you, including the aforementioned teacher. Pardon me if I don't sound overly sympathetic.
Your right to free speech does not allow you to cry "Fire!" in a crowded theatre, just as your right to throw a punch ends one millimetre short of the tip of my nose. A condition of going to your school is that you don't break the rules more than a few times. (The in-school suspension is only a warning, remember.)
The school's policies are there for a good reason. The school is a learning environment. I don't know anything about you, but in my school days, I crossed paths with a couple people who regularly - for all of their half day at the high school - ripped into the teachers with profanity-laced diatribes to show how "badass" they were. Did the rest of the class continue, undisturbed, with their Chemistry labs and English class work? I don't think so. Why would you care to make a stand for your right to show the world you have a flux of the mouth? 'Tis better to be silent and thought a fool than to open one's mouth and remove all doubt.
And out in the "real world", removing all doubt is exactly what you'll be doing, even if it isn't true. Much like I don't bother to go out of my way to read improperly structured writing (by those who can do better - you can nearly always tell the difference between those who speak English natively and those who don't), I will not stand and listen to someone whose opining includes a profane word or three every sentence. To say "The fucking door is locked" is stupid. The individual who uttered it may be very intelligent, but apparently their brain has gone to waste as nobody is going to take them seriously until they turn themselves around. There may be a time and place for public profanity, but school certainly isn't it.
Truly, this is not what you're doing, but if usage wasn't forbidden, this would be what happens. The teacher may have given you a look or said something should you have said it in normal, conversational voice. Shouting it, though, is a flagrant violation of the rule, and is exactly the sort of case that the rule is meant to be applied to. Would you actually argue otherwise? There's a largely unenforced law against jaywalking. Does every jaywalker that any member of the police see get a ticket? How about those who are witnessed to nearly cause an accident?
Amusing also, though trivial, is your classification of the other forbidden acts as belonging to the realm of "dangerous students" whom we must restrict to protect "the student body from harm".