My understanding is that, under the current state of the law, public schools can get away with almost anything in the name of "maintaining order." Usually, a lawsuit against the school will go nowhere, and the final decision will be that the school "acted reasonably."
On the other hand: I suggest that your son write a PAPER letter to the teacher and apologize to her, something like this:
"Dear Ms. Jenkins: I very much regret that you were present when I made a certain hand gesture toward one of my classmates at school. I did not know that you were in the vicinity and had I known you were there, I would not have engaged in this form of non-verbal communication. Young people such as myself frequently err when drawing the line between innocent coarse joking and offensiveness."
My personal opinion is that this teacher and this principal should just get over it.