Just to be clear, I mean to say that the cake on the display case is offered for sale “as is” and per the posted policies. If the store had a sign that said “we will write anything you want on the cake for 20 cents per character” then the baker would have to write whatever the customer asked. But generally, the cake on display is offered for sale as-is and must be sold as-is to anyone who agrees to the posted terms. The baker cannot be compelled to do anything he does not want to do if he did not already offer to do it.
The baker in this case had sold cakes like that to the gay couple before. He had no problem with that.