The analogy here isn't quite the same though: you can pledge allegiance, but you aren't required to. A bill saying that you are now required would be a change in obligations, and patriotic citizens might still oppose that.
This bill, however, is proscriptive: it is saying that you cannot perform an action. It's a hard case to say that we shouldn't put that restriction into law while also believing that discrimination should be restricted.