Respect for freedom of conscience is terribly limited these days—limited, in most cases, to respect for the consciences of those one agrees with. But there is a glimmer of respect in Monday’s 7-2 Supreme Court ruling in favor of a Colorado baker’s refusal to create a wedding cake for a same-sex marriage.

Three of the justices who backed the court’s landmark 2015 ruling in favor of same-sex marriage—Anthony Kennedy, Elena Kagan, and Stephen Breyer—recognized baker Jack Phillips’s right of conscience to refuse to create a cake for the wedding of two men, Dave Mullins and Charlie Craig. What made the ruling possible, for this particular case, is that the court found that Phillips was acting on his “sincere religious beliefs and convictions.” The justices were disturbed that some members of the Colorado Civil Rights Commission, which had ruled against Phillips, seemed to discount the possibility that the baker’s religious beliefs were sincere and not simply a mask for ill will. This led to the majority’s ruling that the commission and Colorado courts had failed to give Phillips the religiously neutral review that the Constitution requires.

The majority opinion, written by Kennedy, brings moderately liberal justices Kagan and Breyer along by giving the ruling a narrow scope, based primarily on the facts of this particular case. The ruling puts a lot of weight on several remarks that members of the Civil Rights Commission made when they heard the case against the baker, especially this one:

I would also like to reiterate what we said in the hearing or the last meeting. Freedom of religion and religion has been used to justify all kinds of discrimination throughout history, whether it be slavery, whether it be the holocaust, whether it be—I mean, we—we can list hundreds of situations where freedom of religion has been used to justify discrimination. And to me it is one of the most despicable pieces of rhetoric that people can use to—to use their religion to hurt others.

Kennedy seizes on that comment in the majority ruling:

To describe a man’s faith as ‘one of the most despicable pieces of rhetoric that people can use’ is to disparage his religion in at least two distinct ways: by describing it as despicable, and also by characterizing it as merely rhetorical—something insubstantial and even insincere. The commissioner even went so far as to compare Phillips’ invocation of his sincerely held religious beliefs to defenses of slavery and the Holocaust. This sentiment is inappropriate for a Commission charged with the solemn responsibility of fair and neutral enforcement of Colorado’s anti-discrimination law—a law that protects discrimination on the basis of religion as well as sexual orientation.

A second Colorado Civil Rights Commission case involving religion and bakeries became an important subplot in the Supreme Court decision. That one involved an evangelical Christian man named William Jack who filed a complaint with the Colorado Civil Rights Commission charging that three bakers discriminated against him on religious grounds by refusing to create cakes that invoked biblical passages to denounce same-sex marriage.

Jack wanted his cake to be shaped like an opened Bible. One of the cakes would depict two grooms holding hands, with a red “X” imposed on the image. There would be an inscription, “God hates sin. Psalm 45:7,” and a passage based on the Book of Leviticus, “Homosexuality is a detestable sin.”