I think the old purpose of marriage was set in the garden of Eden. Its purpose is not just childbirth, but for the prospering of mankind in general.
Further in the Bible we are told that marriage reflects the relationship of the church to Jesus.
The fact that the far best way of bearing and rearing children is within a male/female two parent married household is the fruit of this, certainly. But not the reason for it, as I see it.
God have the reason: “It is not good for man to be alone.” And of course He provided man a wife, not a husband.
I am not religious but I still think you are SO right. Marriage can bring enormous happiness and fulfillment to couples if they are mature and well-matched. Surely, child bearing is not the only reason for the bringing together of man and woman. Important, of course, but not the only reason.
I speak as a very happily married woman!