Government shouldn't be involved in marriage at all.

From a legal standpoint, any consenting adults should be able to enter into a partnership just like they would in a business, and if they want a "divorce" then they can dissolve that partnership. This could include a partnership of one man and one woman, or any other combination of people that wish to join into a communal arrangement recognized by the government. It should include all of the legal provisions that a marriage does.

A marriage should be left alone to be performed as a non-legally binding ceremonial joining of people according to their specific traditions. That way the religious people don't feel like their traditions are being trampled on, and consenting adults that are gay, straight or other can enjoy all of the same rights as any other person does.

Problem solved.