An amazing grasp of the obvious, but I ask you this: should one be forced to stand in respect for another person (and invariably a lawyer at that), while standing to show respect for a country and its people is optional?
You are not standing for the person, you are standing in deference to the court itself. Considering said court is about to decide ones fate, standing by all parties is acknowledgement of the courts authority, nothing more.
I don't see how the school can punish him. However, it can always bring in some vet to ask the kid why he is doing what he is doing. We keep forgetting to go with shame as opposed to punishment as a method of correcting actions we see as detrimental.