The most significant advantage marriage has over cohabitation is that it changes the telos of the relationship. It goes from two people living together because they are fond of one another to a (hopefully) life-long committed relationship with beautiful children, legacy, and growth. Religion does play a part for many people, but even atheists marry. Traditions stick because they are vestiges of what worked in the past.Do you think formal marriage has any advantages over mere cohabitation?
IMO it's just a piece of paper, daily life and issues of living in the same home with another person stay the same whether you are formally married or not. I've seen long-lived relationships which were never legalised, and people who married only to divorce after a few years.
So why do some people say that formal marriage is so important? The only reason I see is religion.
This doesn't always work out of course. I'm not trying to make a black and white statement. Many people are not mature enough or ready for that level of commitment and some people simply don't have the personality for it.