Simply put, from both the natural law and revelation found in Sacred Scripture.
Genesis 2:20b …but for the man there was not found a helper fit for him. 21 So the Lord God caused a deep sleep to fall upon the man, and while he slept took one of his ribs and closed up its place with flesh; 22 and the rib which the Lord God had taken from the man he made into a woman and brought her to the man. 23 Then the man said,
“This at last is bone of my bones
and flesh of my flesh;
she shall be called Woman,
because she was taken out of Man.”
24 Therefore a man leaves his father and his mother and cleaves to his wife, and they become one flesh. 25 And the man and his wife were both naked, and were not ashamed.
There's more that one can get into but this early passage shows the origin of marriage from the start.