I mean…now you’re getting into the realm of words vs actions.
In the case of a freelance contract worker, there’s a difference between saying “I don’t do work for gays and blacks” and keeping your mouth shut (or providing some excuse like that you’re already too booked) and no-quoting that work, in effect not working for these groups.
However in both cases, I believe it is (and should be) legal.
Rude and offensive, sure, but I feel it’s a situation where you have to allow assholes to be assholes because the alternative is compulsory work which opens a whole new can of worms and is an even bigger restriction on freedoms.
So many people in these comments are trying to legislate morality, and it’s just a non-starter in these circumstances.