It can be very, very inexpensive for the costs of a court filing fee and a friend getting an online certification to officiate the wedding.
You get tax breaks while married, and a lot of things in life are easier when you're married and sharing the same living space, bills, etc. The world has been built to make it more economical and easier.
It's the getting divorced that's expensive and sucks. As long as you can avoid doing that, or have a prenup in place, you're good.
There've been a lot of mistakes made over the years.