Your example is the case of an antiquated law that has fallen into desuetude. That is not the case here, apparently.
If you are embarrased by the "circle the wagons" law, call up your legislator and ask him/her to get it removed.
You don't have the right to unilaterally decide which laws are "stupid" and therefore don't apply to you personally, and neither does this teacher. If you don't like it, too bad. That's the price of living in a republic governed by laws.
During the 1960's civil rights advocates violated many different laws written in many different states. These laws were disciminatory to say the very least. They were, however, the law. Would you advocate that these laws should never have been challenged simply because they were on the law books?
I don't have the complete story, yet, on this case. Maybe there is more to what the teacher did that justifies the school's response. But, if the only reason for his dismissal is that he displayed flags of other nations in his classroom (on geography), then I don't agree with the law and it should be challenged. If that challenge requires violation of the law, so be it.