This explanation (read the whole thing) by Eugene Volokh (a libertarian/conservative) in The Washington Post makes it much more understandable.
Statutes prohibiting similar communications (including as to race, religion, and sex, and as to employment and housing as well as public accommodations) are common, and generally thought to be constitutional. But why? Here’s what I think is the right answer, though I agree that courts haven’t been clear on it.
Assume that it is indeed against the law to refuse to serve someone based on race, religion, sexual orientation, and so on — and, in particular, to refuse to provide a cake for a same-sex commitment ceremony. Then, saying we “will … refuse” to provide a cake is essentially a true threat of illegal conduct.
To be sure, it is not a threat of violence, or even a threat to commit a crime, but it is a threat to act illegally (by violating the anti-discrimination statute). And it is a threat that would have much the same effect as an outright refusal to provide a cake to someone who shows up and asks for it, because it tells people that it’s futile to even ask.Makes sense. Of course, if one does not believe the state has a right to order the bakery to bake the cake, then the question is moot, but as far as the gag order is concerned, based on this logic, it seems reasonable..