Frankly, it's about legality. Simplifies transfer of property, etc. in the event of one partner's death (also there's no question of where the child goes if something should happen to one of you, which might not necessarily be the case if she dies, you might have to contend with her family). Additionally, it's a break in terms of taxes, insurance, etc.
Less to do with religion than money, seriously, historically that's what it's always has been, the transfer of property to the legal offspring. Who the mother is has never been in question. That child comes out of her body. The father

he has to accept the child. Marriage removed the option of him saying, "this isn't my kid." The child of the woman he was married to was legally his own, no discussion.