The gay marriage issue reminds me of the argument between the church and the state over the investiture of bishops. The church was a major landholder in the middle ages. Because of this it had to answer both to the king and the pope as land was the key source of wealth and control of land and the income and food it generated was an important means by which authority was exercised. Sometimes this resulted in issues of divided loyalties. Both the secular and the religious authorities demanded submission to their interests. This was particularly important when a new bishop was being put in place. Was the new bishop going to be the king's man? Or the pope's?
This was an important issue. The investiture controversy was resolved by disentangling the temporal elements of church office from the spiritual ones.
But the issue gurgled on. It played out in the dispute between Henry II and Thomas a Becket, with the latter murdered by a bunch of knights in Canterbury Cathedral. Henry was shocked that the chap he elevated to the responsibility treated his archbishopric as an independent source of power. Exasperated, the king famously is said to have asked (something like) "Who will rid me of this turbulent priest?"
With marriage, there are a similar mix of elements.
The solution is bound to be this. The civil elements belong to the government. The religious elements belong to the religions.
So there is something called religious marriage. It has no tax or legal advantages but it is a thing for people who believe in a particular type of divine teaching.
And there is something called civil marriage and that is governed in law.
So long as that is understood and respected, no side should feel wounded beyond repair.