Think of it in terms of business because in the end marriage is essentially a business. A business can deny you service on any basis. They reserve that right because they can go somewhere else to go get what they need. Same thing for marriage, religious institutions aren't the only ones that perform marriage ceremonies or joinings
English
-
But government is not a business.
-
Religion isn't government
-
But issuing marriage licenses is a government job, not a religious or private business one.