Here's a thought:
Get the gov't out of the "marriage" business entirely. All gov't sanctioned partner unions are civil, with a civil license/ceremony. Call it a civil union, a civil marriage, whatever, but recognize that this is the civil contract part of the equation that is enforceable through our civil court system.
If someone also wants a "marriage" ceremony through a church, they can go do that, too. This will be the religious contract/sacrament/etc. the terms of which are between the parties, their church, their God, etc., but not enforceable in civil courts.
This way the gov't isn't being forced to recognize a religious relationship, and religious groups aren't being forced to sanction something offensive to them.