No, you have the facts of the case confused.
What happened in that case was that he was married to the mother at the time and legally presumed to be the father unless he disputed it within the time of the statute of limitations. He got a divorce and then tried to come back after the time had elapsed to dispute paternity because he found out later that he was not the father.
The court decided that even though the facts were unfortunate, public policy was in favor of protecting the interest of the child in having a stable provider and enforcing the statute of limitations to bring the claim.
So far as I know, there has been NO CASE ever that a man was made to pay child support solely because he helped out a woman while she was pregnant.