The idea of court ordered spousal support and child support emerged from English Common Law. The government did not want men to financially abandon their wives and children. The Crown felt obligated to help the poor and needy. The English Courts gradually created a legal obligation for husbands. With very few exceptions, men were primarily responsible for supporting their wives and children.
When the courts granted a divorce, this obligation continued. If another person provided support to a man's wife and children, that person could sue the husband to seek reimbursement for their "necessaries." If a hospital or doctor provided medical care for a man's wife or child, the husband was the person financially responsible to pay.
As to children born outside of marriage, the mother was primarily responsible for their support. A man could voluntarily take responsibility and to acknowledge his children. Otherwise, the children were legal "bastards" and their mothers were likewise responsible to third parties that provided for them. Of course, this brings to question the entire idea of support. If the state was fearful of public charges, why not make the fathers of these children pay as well. While this was true, the Crown believed in the sanctity of marriage. If the state provided support for these children, women, who had control over their own bodies, it was reasoned, might not wait until marriage to engage in intercourse, and might destroy the institution of marriage. Thus, the state rationale was balanced in favor of marriage and against the support of legal bastards.
When the United States was born, the state courts generally adopted English Common Law (except Louisiana that was French). Legal obligations remained pretty much in check until the 1960s, with only a few states tipping the scale in favor of supporting out of wedlock children. In 1968, the United States Supreme Court entered a landmark opinion that gave children born out of wedlock equal treatment with children born during a lawful marriage. Therefore, just as men were responsible for supporting their children born during a lawful marriage, so were they liable to support their children born outside of marriage.
Only after the United States Supreme Court adopted gender equality did the states require mothers to pay support for their children.