Historically, women have suffered most from matrimony.
Absolutely every human society has come up with something akin to marriage. Why? Because it is protective of women, that’s why. Pair bonding makes up for the vastly greater investment in children that women make (on purely biological grounds, sperm is cheap, maturing an egg is not). Marriage and its various kin is simply the public recognition of said pair bonding.
The whole thing exists because it is to womens’ benefit that it does.