"Why must everyone and all stand up when a judge enters the courtroom?
Yes. Why must everyone and all stand up when a judge enters the courtroom?"

Because we are talking about two different things. One is the freedom of people to celebrate their patriotism any which way they choose to without retribution from a government law. 

The other is respect for the person and their title when the come into a room. As mentioned in a episode of "West Wing" entitled "Bible Lesson" - "In this building, when the President stands, no one sits".