I always told my kids not to stand or say it and to explain to the teacher that they do not swear allegiance to a flag with arbitrary meaning.
They probably still did it, but I made sure they knee they didn’t have to and why I disagreed with it. Still get to make their own, informed, choices.