Historically marriage was seen not just as commitment between two people but between them and their community, and them and G-d. By committing to the marriage in a public, religiously-affiliated place, the couple is acknowledging their responsibility to those parties as well.
If nothing else, it makes the commitment stronger and creates greater incentives to work through issues rather than bail. You can think of G-d and community as additional "accountability buddies" here.
You can say that's stupid, and that it should simply be a commitment between two people and that's it - but you have to acknowledge that the rise of that idea is very correlated with the rise in the diverse rate.
Divorce rate is declining, likely because people aren't being pressured to enter into long-term commitments they aren't ready for by their broader community.
It is interesting to see how conservative ideas are re-packaged to remain fashionable with the time.
I was lucky to be raised by extremely great parents who have never been married and nonetheless have stayed together for 40 years, without God looking over their shoulder.