Hell, one of my friends tried to do that at school, even got permission from the principle. He ended up getting shouted at for half an hour by a teacher.
While I think it is good that your friend decided to do this (even better that he got permission from the principle), one of the rules that a lot of states have for their schools (having both parents as teachers you hear a lot about school rules and regulations) is that protests and other demonstrations such as the day of silence are fine as long as they "do not disturb or interrupt the learning process of the student or other students at the teacher's discretion". As such if a teacher decides that a demonstration is interfering with either the student's learning process or those around them (such as if they were trying to group work and he wasn't talking to his group members, or if he had to make a speech but wouldn't talk, or even if the teacher deemed that they were unable to tell if the student was learning the information due to their unwillingness to answer questions) then they would be well within their rights to ask the student to stop while in their classroom even if the student had principle permission. It's the same reason why even if a school has a sponsored "hat day" where you can pay a dollar to wear your hat in class teachers can still ask you to remove your hats as long as you are within their classroom.
Of course once you get to college it's a whole different ball game, and working is fine too, but while you are in high school and lower there are a lot of things that teachers can ask you to do (such as stopping a demonstration for the duration of their class) and technically you need to comply. It doesn't mean that it's very nice of them to do so, but they do have the right.
Of course if the whole thing was because the teacher was anti-gay then he would still be within his rights to ask the student to stop, but it would be a very fine line that could easily get him fired, especially if he was swearing and the student's parents brought the matter to attention. The standard procedure in most states at that point would be to immediately place the teacher on leave until the matter could be resolved, at which point either the teacher would be fired, punished, or reinstated to teach again.