I was in Boy Scouts and I did the Boy Scout Oath and Law and I treated it seriously. But it was a voluntary association. My free will choice as a boy.
I also did religious pledge things, signed non-disclosure agreements at workplaces, etc. All voluntary.
Pledge of Allegiance? It’s not voluntary.
Compulsory schooling can be argued for. But I don’t see a valid argument for compulsory allegiance. You’re bound by the school laws and civil and criminal laws. But your heart is yours.