IN 2012, Jack C. Phillips declined to design a custom wedding cake for a gay couple who entered his bakery, telling them that his Christian faith prohibited him from crafting cakes for same-sex marriages. The couple sued — and last week Mr. Phillips's lawyer made the case before the Supreme Court that the baker had a constitutional right to refuse the request. The justices should reject this radical proposition.

The laws of Mr. Phillips's home state of Colorado prohibit public accommodations — such as bakeries — from discriminating on the basis of sexual orientation. The baker has no objection to a selling a cake off the shelf for a same-sex wedding, but he argues that creating a custom cake would force him to celebrate that union. In his view, that's a violation of his First Amendment right to speak as he chooses.

Yet by all accounts, the happy couple did not ask Mr. Phillips for a cake bearing a message with which the baker might disagree — such as "God Bless This Gay Marriage," as a group of First Amendment scholars hypothesized, or a rainbow flag. That could make for a harder case. Instead, the would-be customers stated only that they were seeking a wedding cake before Mr. Phillips said he could not serve them.

Mr. Phillips argues that producing any custom cake for a same-sex wedding would communicate his personal celebration of the ceremony. But most people wouldn't interpret the paid labor of florists hired for a wedding to be an endorsement of the couple's union, either. Arguing before the justices, Mr. Phillips's attorney struggled to draw a consistent distinction between her client's work as a "cake artist" and that of the hairdresser or caterer.

For just that reason, the Supreme Court will find it hard to grant Mr. Phillips an exemption without bringing the entire structure of anti-discrimination law crashing down around him. What if, as Justice Elena Kagan asked, a chef refused to serve a same-sex couple on their wedding anniversary? What if a baker refused to craft a custom wedding cake for an interracial couple? Both Mr. Phillips's attorney and U.S. Solicitor General Noel J. Francisco insisted that discrimination on the basis of race would not be tolerated, but they could not make a clear case as to why Mr. Phillips's objections were different.

Chief Justice John G. Roberts Jr. and Justice Anthony M. Kennedy both suggested the need for tolerance not only on the part of Mr. Phillips and his supporters but on that of gay Americans as well. Perhaps the couple could have sought out another baker rather than forcing Mr. Phillips into an awkward situation, Mr. Kennedy mused. To be sure, many well-meaning people may have found the cultural shift toward full acceptance of same-sex marriage to be uncomfortably rapid. But politeness and tolerance are social values, not legal principles. They are not reasons to overturn anti-discrimination law. When a "cake artist" opens the doors of his bakery, he commits to serving all customers equally.