And the solution seems to me to be fairly clear—a separation of religious and quasi-religious ideals of marriage from the civil/legal aspects of marriage. You should have a defined legal state, that could be called “marriage” or “civil union” or “civil marriage” or whatever else we want that’s recognized by the state on a non-discriminatory basis. And then religious groups can also have whatever kind of ceremonies with whatever attendant status they like. If the Catholic Church doesn’t want to perform marriages for gay couples or allow divorced people to remarry, good for them.
Sounds good to me.