The state wants people to go through a licensed medical professional in order to minimize the administrative cost of fact-finding. For one thing, cases like this can result in near-endless litigation that imposes a substantial cost on the court system; more frequently, people may make bogus claims about non-responsibility in order to evade their child support obligations, so basically the state says that the burden of proof is on the donor, and the standard of proof is confirmation from a state-licensed medical professional.
Yes, it assumes the worst about people and effectively invalidates a whole swathe of private contractual arrangements, but experience sadly suggests that the honor system doesn't work very well in this area.