The Supreme Court will hear arguments Tuesday in the case of a Colorado baker, Jack Phillips, who refused to make a wedding cake for a gay couple. Although Colorado law bans discrimination in public accommodations, some may feel tempted to sympathize with Phillips, who argues that the First Amendment protects both his religious and expressive freedom to choose who buys his cakes.

Most commenters have focused on whether baking a cake is, in fact, a religious or artistic exercise, which is likely a stretch. But even if the court agrees with such assertions, Phillips should still lose the case.

The reason is that the Constitution guarantees a right to equal dignity, and turning people away from public accommodations — or slicing up the public by granting individuals a license to “opt out” of the public weal — denies people that dignity. No constitutional right is entirely unrestricted, but in deciding the balance between First Amendment and equal protection claims, the courts have already distinguished between the right to hold or espouse a belief — considered “absolute” — and the right to act on it with impunity. The “free exercise of one’s belief,” the courts have said, is “subject to regulation when religious acts require accommodation to a society.”

While Phillips’ lawsuit is, strictly speaking, a public accommodations case, the Supreme Court’s recent rulings on same-sex marriage bolster the argument against his right to opt out of the public. In his eloquent 2015 decision in Obergefell v. Hodges, Justice Anthony Kennedy wrote that gay people are entitled to marry because the Constitution guarantees them “equal dignity in the eyes of the law.”

Access to marriage, he reasoned, is as much about equal dignity and public recognition as tangible rights or benefits. It’s a key point that ties together public accommodations and access to marriage: Neither is solely about enjoyment of material things; both are also about the dignity that comes with fully belonging to the broad public.

This means not only that individuals can’t be denied access to public accommodations (in commerce) and recognition (in marriage) but also that individuals who offer such accommodations and recognition can’t selectively exempt themselves from belonging to that public based on who seeks their service. If the Supreme Court were to find a constitutional right to discriminate, virtually any business could claim exemption from federal and state civil rights laws, shattering protections not just for lesbian, gay, bisexual and transgender people, but also racial minorities, women, the disabled and others.

Indeed, Kennedy’s opinion rested on and expanded decades of legal reasoning that has made the right to equal dignity a central guarantee of our Constitution and has established the role of a robust public in making that possible. Congress passed the Civil Rights Act, declared a Senate committee, to prevent the “deprivation of personal dignity that surely accompanies denials of equal access to public establishments.” Discrimination, it continued, “is not simply dollars and cents, hamburgers and movies; it is the humiliation, frustration, and embarrassment that a person must surely feel when he is told that he is unacceptable as a member of the public.” As a Supreme Court opinion stated in upholding the law, its main purpose was “the vindication of human dignity and not mere economics.”

The role of a cohesive public in conferring that dignity is especially pronounced when it comes to marriage. By definition, marriage is a private union that’s sealed by public action. Any two people can pledge a commitment to each other, but it’s the recognition of their community and state that makes it a marriage. Granting individual exemptions erodes that public recognition.

This is why the government’s approval was central to gay people’s quest for marriage equality — for reasons that went beyond simply financial and legal benefits. (Otherwise “civil unions” would have sufficed, offering the same rights without the word “marriage.”) Gay people sought legal marriage because full access to this fundamental American institution was integral to enjoying the equal dignity of first-class citizenship.

And this is why Jim Obergefell went to court: to ensure that his name appeared on his husband’s death certificate. He stood to gain nothing material — just the dignity of having his 20-year commitment recognized by the state instead of wiped into oblivion. It was a case, his lawyer said, about “love surviving death.”

Equal access to the public sphere means equal access to the full public. Nothing less guarantees full dignity. Yet Phillips seeks to opt out of the public in “public accommodations,” something not essential to expressing a religious belief or artistic impulse. Marriage, like commerce, requires a public, and the public is all of us.

Nathaniel Frank, director of the What We Know Project, is author of “Awakening: How Gays and Lesbians Brought Marriage Equality to America.”