Marriage is the fundamental building block of human civilization.
It came way before the government. Government recognizes marriage because it benefits society in a way that no other relationship does. Marriage connects people and goods that otherwise tend to fragment. It helps to connect sex with love, men with women, sex with babies, and babies with moms and dads.
Every government essentially has regulated male–female sexual relationships. This is not because government cares about romance particularly. Government recognizes male–female sexual relationships because these alone produce new human beings and those new human beings are full supervision of their parents.