A Kansas man who donated his sperm on Craigslist, and who entered into a written contract "protecting" him from having to pay child support, was still forced to pay child support by the court, because he did not donate his sperm through a licensed physician or a sperm donor bank.
Ironically, the law in New York is not very different. Surrogacy contracts "relinquishing" parental rights are against public policy in New York State and will not be honored by the courts. Donation through a sperm bank is permitted since the contract is with the sperm bank and not the prospective parents.
New York State has other laws which may "protect" sperm donors. For instance, the doctrine of equitable estoppel may disallow child support as contrary to the best interests of the child. As always, it is prudent to speak with a family law attorney who is knowledgeable with this area of the law.