You didn't deserve that at all, and I can relate to how you feel. My nemesis in high school was an absolute bastard of a gym teacher who missed no opportunity to mock me for being shy and not a jock at all. I think the low point came when I wrote a poem as a tribute to Robert Frost, who had just died. The gym teacher said in our class that "all poets are queers" and "only queers write poems about other queers". What a piece of work. Another occasion he blamed me for writing a term paper on North Vietnam: he asked me if my parents were "commies" and wondered why I would write a term paper about an African (!!!!!) country without any culture.
I wonder if assholes like this can still get into the system. I hope not. I watched for it when my own kids were in school here in the UK, but nothing like that appeared.
Nobody living can ever stop me
As I go walking my freedom highway.
Nobody living can make me turn back:
This land was made for you and me. (Woody Guthrie)