Marriage was a religious union before it became a legal contract, so marriage is a social/religious/cultural institutuion and not some just some papers you sign to share property.
Sure.
But as it exists today they are PARALLEL institutions.
I can have a marriage ceremony in a church and not be legally married. I can have a legal marriage outside of a church. QED.
The church's involvement in marriage is ceremonial and exists more or less according to the preferences of the couple getting married.