In most states, “a trip to court” doesn’t end a marriage immediately. There is usually a significant waiting period before it’s final.
This guy married this foolish woman and a child was born during the period of the marriage. It's up to the guy to deal with his own problems.