If I recall in the baker’s case, the state didn’t even recognize same sex marriage. How can it be criminal to deny a cake for a “wedding” in a state that doesn’t even legally recognize the marriage? The customers were free to buy a cake, just not a wedding cake. There was no denial of service.
A book publisher can reject a manuscript and a printer can deny your book/magazine publication on the basis of personal objection.
In today’s liberal politically correct world, it doesn’t matter whether homosexual marriage is even legal in a state in which these incidents happen. Because homosexuals are apparently at the top of the pyramid of grievance groups, they get their way in any legal dispute of any kind.