If a student wants to sound religious and refuse to do the pledge, the best excuse is to say allegiance to a THING, such as a flag, is idolatry. Most students bleat the pledge; they don't say it.
I won't do the Pledge any more. But, even when I still did, I just went silent for the "under god" part, & picked it up after. I think the wording is archaic & inane & should be reworked, as I also would like a better Anthem.