Here in MT our current code on the books is actually pretty legit. The Pledge is mandatory, since of course we all live in this nation and you should strive to uphold the values of liberty and justice for all. BUT, any teacher or student who does not recite the pledge is legally immune from even being recorded as having done so.
Sort of a, "Hey you should do this but the blind eye is turned on you." deal.