I am not quite sure what you are trying to say.  But I think you are looking at it from the wrong end.  A business open to the public, Masterpiece Cakeshop, is refusing to provide a cake for a gay couple.  The business is not participating in a religious ceremony, nor is it practicing a religion.  (Businesses do not have religions.)  Since it is open to the public, it may no more discriminate against gays than a diner in the South could lawfully refuse to serve black people.