Freedom Of Speech In Schools

WTF?! Some kid in my math class was getting bitched at by the teacher and the teacher yelled, “You didn’t do SHIT!”. Then the student comes back with, “I did do shit, bitch!”. And yet only the student is getting punished. WTF?!!!?!!
I thought freedom of speech of protected by the constitution!!!