I think there's a clear line here.
If I owned a bakery, and someone can in to buy any generic item that I had on the shelves, offered for sale, nothing about the personal lives of the prospective customer, or what he intended to do with that item, would be any of my business. If he bought a cake I had already made, and intended to use it in a sick mockery of a wedding, I would not know or care. None of my business.
But wedding cakes are usually not generic items. They are nearly always custom-made items, specific to that one wedding. They represent an artistic expression on the part of the one who creates them, in support of the wedding at which they will be used.
If I were a baker, and someone came into my shop wanting me to make a custom “wedding” cake to be used a sick mockery of a wedding, with two “grooms” or two “brides” depicted thereon, I would refuse. Marriage is sacred to me, and I would never willingly take part in such a disgusting mockery of it. I cannot force others to refrain from such sickness and immorality, but I certainly can and will refuse to take any active part in it myself.