The judge addressed that question (which is why Glenn Sacks commentary stinks because he ignored that salient point) and the answer was that their agreement didn’t conform to the requirements of the Uniform Parentage Act and so was unenforceable as a matter of public policy.
For a contract to be legally enforceable, it has to conform to the law.
I perused the Uniform Parentage Act and it does state, in so many words, that if a man says he is the father...then he is financially responsible.
To this end, even if you have a contract drawn up....it does not seem to matter. My understanding, according to the UPA, is that if you claim parentage....you are responsible...period. What is your opinion?