I don’t mean to blow your mind but this isn’t always true. Depending on the state and the individual circumstances the donor may have legal rights/obligations to the child.
In cases of true sperm donation with no rights or responsibilities for the donor, it’s legal because it provides a valuable benefit to society. Sperm banks let people who otherwise couldn’t have babies have babies.
Leaving the father’s name off the birth certificate doesn’t abrogate him from his responsibility in any meaningful way. Since the mother can pursue him in court at a later date, why would anyone waste time investigating immediately?
You seem in general to feel there’s an inequality in men and women’s rights and obligations as parents but in this example it’s literally impossible for a man to do the same to a woman. It’s not as if society has decided we won’t stand for a man gestating a woman’s baby for 9 months and giving birth without ever telling the woman. It’s biologically impossible.
It’s not acceptable to abandon children, but moms and dads have equal rights to let another person adopt a baby. Then a person who wants a baby agrees to care for the baby and its needs are met and society isn’t burdened by an unwanted infant. It’s a good thing. A parent unilaterally refusing to care for his child and forcing the other parent to shoulder all the burden isn’t a good thing for society or the child. That’s why adoption is allowed but being a deadbeat parent isn’t.