Terrible advice. Most western countries would treat what you mentioned as a "common-law relationship", which entitles the partners to the same rights as a marriage. Check you local legislation. In Canada if you live with someone for more than 2 years, it's equivalent to a marriage in almost every case.
In my experience proving common-law relationship is tricky because it’s very undefined, and you may think you meet the requirements but the documents authorities will demand (because they do, they don’t just take your word for it) aren’t something most couples think of setting up until the time/need comes. Much easier to just show a marriage certificate.
There may be only seven states that recognize the creation of common law marriages, but all the other states will recognize the existence of a common- law marriage created in one of those seven states.
So… get married because the government has made it inconvenient not to? Aside from the fact that this is factually wrong (see other replies to your comment) this is also an awful reason to marry someone.
How do you get that conclusion from my comment? Lol. If anything, my comment suggested that don't even live together with someone, let alone get married. Because living together is legally the same as getting married in many jurisdictions. I might have been mistaken about the amount of places with such laws, but it's always a good idea to check your local legislation or talk to a family lawyer.