This is the problem with people saying "this isn't legal in America": it's all based on how good your lawyer is, and if you can't afford Johnny Cochrane, you get screwed, no matter what the law says.
Like I said before, either your friend lied or he needs a better lawyer. Given the story that you stated, the law is definitely on his side.
Anyway, he fought back and is now a very dedicated father. He has visitation rights, and soon enough the childs decision to move in with her Dad, because her Mom is a criminal, will be ratified in court ..
i have a further thought - i am a legal owner of an “intimate partner” storage account where my partner’s sperm is stored for only my use as their spouse. even with the very very low FDA testing/paperwork bar for this type of account, there’s a paper trail that can be followed and a chain of custody for every single vial ever used. they’ll have even more documentation if the friend’s sperm was ever for sale.
The relevant law in California states that sperm donors are not legal parents: “The donor of semen provided to a licensed physician and surgeon or to a licensed sperm bank for use in assisted reproduction of a woman other than the donor’s spouse is treated in law as if he were not the natural parent of a child thereby conceived, unless otherwise agreed to in a writing signed by the donor and the woman prior to the conception of the child,” states California Family Code 7613.