It’s not necessarily costly. You can have a cheap wedding and in the US for example you get access to “married filing jointly” tax treatment which can lower your taxes and increase your retirement savings in many cases
I can't speak to the us, but where I live there are no tax or legal benefits to being married vs being a defacto couple (apart from it being slightly easier to prove if it ever goes to court)