There are also religious and spiritual purposes to marriage, but the law does not necessarily have to be concerned with those.
The marriage agreement only needs to cover natural children, and not adoption. Any adoption would require the new parents to sign a separate adoption agreement for the care of the adoptive child.
But the marriage law has gotten completely disconnected from parental rights and responsibilities. In California, the family court decides visitation and custody rights, and orders child support, without even considering whether the parents were ever married or not. There might be some states where marriage makes it easier for a father to get some custody rights, I don't know. But marriage never makes custody rights automatic, and it never has a bearing on child support.
With nearly all states having so-called no-fault divorce, the marriage contract is never binding on anything related to the kids. It only affects certain financial matters in case one party bails out. The law even makes it impossible to make any binding agreements about the kids. No matter what any contract says, custody is determined by what the judge says is in the best interest of the children, and child support is determined according to a formula.
The same-sex marriage debate is just a symptom of how marriage law has lost its purpose, not a cause.
Here is a Focus On The Family page with arguments defending "natural marriage". It says:
The Public Purpose of Marriage ...These arguments are lame, and are easily rebutted by the gay lobby. Conspicuously absent is the argument that marriage is a joint agreement of responsibility for resulting children.
Marriage is a common good, not a special interest.
Every society needs natural marriage -- as many men as possible each finding a woman, caring for and committing himself exclusively to her -- working together to create and raise the next generation.
No society needs homosexual coupling. In fact, too much of it would be harmful to society and that is why natural marriage and same-sex coupling cannot be considered socially equal.
My theory is that Dobson and others like him are unwilling to make a stronger case for marriage in terms of child-rearing responsibilities because they want unwed fathers to pay child support, and they want divorced moms to get custody of the kids. Once they take those positions, then it is no longer the marriage that creates any rights or responsibilities for the dad.
If the marriage is not creating any parental rights or responsibilities, then they are left with weaker arguments for marriage, and the gay lobby can easily match those arguments. So can various others who want polygamy and other arrangements, as Robert P. George point out.