Should it be a punishable crime for a father to not take responsibility over his child?

For example, a man gets a woman pregnant, and he ditches her after he finds out about the pregnancy. should this be a crime? If it should be ok for fathers to ditch their children, why shouldn't single mothers have the right to abandon their kids at the playground and never see them again?
Updates
+1 y
why should prostitution be illegal, but abandoning a human life that desperately needs you be legal?
Should it be a punishable crime for a father to not take responsibility over his child?
Post Opinion