Marriage is more than just some religious ceremony, it carries power in the State. The State recognizes marriages. And the reason it does has to do with property and estate rights. One of the key reasons gay marriage was pushed was because gay people wanted a legal channel so that if anything happens to them their property automatically goes to their spouse as opposed to family who rejected them. This was very difficult on States where their marriages were illegal (which also meant their Civil Unions) were illegal.
If an institution offers marriage, it doesnt make sense to then grant them the right to discriminate, as again, that leaves the door open for them to say they won't marry black people either. Or Latinos. It's ridiculous. Or even worse, interracial marriages which some people now in 2025 still believe should be against the law based on the belief that it's against their religion. Race mixing shouldnt be a thing.
If we are going to give legal power to these superstitions then the State has ever right to regulate them and tell a Church if they discriminate, then they dont get the legal power.