Generally, across all cultures, marriage is about status, and mostly, that means property. With thousands of human societies, there are many examples, counter-examples and exceptions, but I stand by the generalization. Obviously, we can find the roots of property in animal territory. We know from observation that even dogs and cats perceive "fairness." But, humans represent a quantum leap over animals. How and when might have been dramatic or maybe it just seems that way from our perpective. (A geology professor once told me that the eons are like pages in a book: you can read this page, the previous one, or the next one, but you can't read the edge.) The bottom line is that from our experience at least since the last Ice Age, the reason that dogs cannot marry fire hydrants - much as they seem to like them - is that neither the dog nor the hydrant can petition a court to recognize the union. Can a human marry an animal or an inanimate object? Again, the barrier is reasoned consent. Absent reason, consent cannot exist.
The discussion here touched on many points over 15 posts. A lot was said. Marriage is not necessarily religious. It is true that most societies have religions that explain their rites of passage. But my mother's second marriage took place in the mayor's office. A justice of the peace, a magistrate, the captain of a ship, heck, the captain of an airliner, or your favorite aunt can officiate the ceremony. The papers are filed with a civil authority, the county clerk typically. But, people have been married within religious communities that were outside of civil law, extreme Protestants in extremely Catholic places, Jews almost everywhere.
When I was in high school, we leered over the fact that the age of consent in Maine was 14. It has since been changed. But that speaks to a problem here with Sharia Law. Does a "community" (however defined; and that definition is highly consequential) have the right to its own laws? Does a city or a state? Can you have a city with majority rule Sharia Law? Yes, much might be challenged as contrary to the US Constitution or the state constitution. But that speaks to the very core of objective law. Back in 1968, I volunteered briefly to gather voter registrations working with the Democrat Party in South Carolina. But the party rules still held to the old state laws against miscegenation. I was not supposed to register someone who married outside of their race. So, I quit before I got started. That was an example of a "society" an American state with its own "community" laws. Again, you could vote if you were white and you could vote (in theory) if you were colored. But you could not vote if you were a white person married to a colored person because marrying across racial lines was illegal. The state defined marriage.