You are completely misunderstanding the ruling by the SCOTUS. They actually dodged the question and made no ruling regarding the baker's actual right to refuse to bake a cake for the gay couple. The ruling was more of a condemnation of Colorado's Civil Rights Commission and that they treated the baker's religious beliefs unfairly. From the written ruling:
The government “cannot act in a manner that passes judgment upon or presupposes the illegitimacy of religious beliefs and practices,” Justice Anthony M. Kennedy wrote for the majority. In considering the baker’s case, the commission “was neither tolerant nor respectful of [baker Jack] Phillips’ religious beliefs.”
and:
Yet even as Mr. Kennedy insisted that the law “must be applied in a manner that treats religion with neutral respect,” he also indicated that Colorado’s law itself was valid: “Colorado law can protect gay persons . . . in acquiring whatever products and services they choose on the same terms and conditions as are offered to other members of the public.”
and:
Finally, Mr. Kennedy warned that the court could not, in the future, rule expansively in favor of a baker’s religious claims, “lest all purveyors of goods and services who object to gay marriages for moral and religious reasons in effect be allowed to put up signs saying ‘no goods or services will be sold if they will be used for gay marriages,’ something that would impose a serious stigma on gay persons.”
https://www.washingtonpost.com/opin...ory.html?noredirect=on&utm_term=.1711f7a01011