There is a real simple solution to all this silliness. Marriage should be a religious institution only. Then any church can allow or disallow marriages for whatever reason their Gawd deems reasonable. Why is my relationship any business of the governments anyway?
Basically, it goes back to the days when the dividing line between religion and civil government was much fuzzier, if it existed at all.
Nowadays, various reasons are given, including stability of family life, recognition of the human desire to pair off, recognising that there is a person who is the closest to you, &c.
The Germans have an interesting take on it. You can be married in the cathedral by the Pope if you like, but first you have to go down to the registrar's office, fill out some forms, and become "legally united" for the purposes of the government. And if you choose, that's all you need to do to be married for government purposes. And if you don't do that, the Pope waving his hands over you is of no interest to, nor recognised by, the German government.