Marriage is simply a human need as long as it still takes 20-30 years to raise children. If you do not at least promise your partner to be there until the end of life, there can be no (perceived?) certainity that you are not shooting yourself in the foot by getting children.
And because raising kids takes so long, and needs full energy by a couple, society (religion, state, etc) supports being loyal to each other in many ways.
And it is good that way.