In fact, a large chunk of existing tax law deals with all the possible combinations of households with children and parents, where the parents may or may not be living together, and may or may not be married to each other. It is designed to fairly accomodate unmarried people, not to encourage marriage.
A vengeful judge and spouse can easily wreck one’s finances unfairly.
Child support makes sense in theory, but is butchered in practice. The judgements often have little to do with how much it actually costs to support the child and is more about a percentage of income.
Let's not forget, the state is the third party in a divorce. They do not want to support anyone when they can force one of the other parties to do so.
[1] https://calmatters.org/projects/california-keeps-millions-in...
However, there are also plenty of welfare programs that are means tested so marriage is ruled out.
(One of the leading theories for the number of babies born out of wedlock rising so much since the early 1960s is the end of the shotgun wedding: the baby daddy counters by pointing out that the mom will lose out on a lot of benefits if she gets married)
This hardly mattered years ago, but with median wages getting around 70k+, a lot more people pay this penalty for getting married.
In the US at least, the financial and legal incentives for women to divorce is far, far greater.