The U.S. Supreme Court ruled 7-2 Monday that a Colorado baker’s right to exercise his religion had been denied when a state agency penalized him for declining, based on his religious beliefs, to create a custom cake for a same-sex wedding. Justice Anthony Kennedy wrote the opinion, and even liberal Justices Stephen Breyer and Elena Kagan joined.

That’s the good news. The bad news is that it took flagrant, ugly, religious bigotry by Colorado officials to reach this result.

In 2012, Colorado did not recognize same-sex marriage. The Supreme Court had not yet recognized a constitutional right to same-sex marriage. The Colorado Civil Rights Commission had decided in favor of bakers who would not create cakes with anti-gay messages.

The baker in this case, Jack Phillips, declined only to design and create a custom cake for this specific event; he would have sold anything else that was generally available to the public. In fact, he has done such general business with everyone, including gay people, for nearly a quarter-century. You’d think these facts would be enough for a unanimous decision in his favor.

You’d think that, but you’d be wrong.

The Supreme Court described, in detail, how the Colorado officials displayed “clear and impermissible hostility toward the sincere religious beliefs that motivated [Phillips’] objection.” Members of the Colorado Civil Rights Commission, for example, “endorsed the view that religious beliefs cannot be legitimately be carried into the public square or commercial domain.”

In other words, business owners can believe what they want personally, but may not act on those beliefs. So much for the “free exercise” of religion.

One commission member said that “religion has been used to justify all kinds of discrimination” and that “it is one of the most despicable pieces of rhetoric that people can use to—to use their religion to hurt others.” Kennedy noted that “[t]he record shows no objection to these comments from other commissioners.”

America’s Founders not only listed the free exercise of religion as the first individual right protected by the First Amendment, but they also believed that it took precedence over other political priorities.

The United States has signed multiple international agreements asserting that the right to freedom of religion and to “manifest” that belief “either alone or in community with others in public or private” is a fundamental human right. Congress had unanimously declared that the “right to freedom of religion undergirds the very origin and existence of the United States” and “is a universal human right and fundamental freedom.”

The Declaration of Independence states that securing such rights is the very purpose of government. The Universal Declaration of Human Rights, to which the U.S. is an original signatory, affirms the duty of governments to protect these rights by law.

And yet, today in the United States, it takes rank bigotry—expressed in public by government officials—to get some action to protect religious freedom.

The decision Monday was obviously correct and should have been unanimous, and perhaps it begins to expose how precarious our most fundamental freedoms really are.