How is raising someone else’s child a moral obligation? If a man’s wife has a child with her lover her lover has an obligation to raise the child. He’s the father. The mother’s husband has no relation to the child.
We should note that, yes, being the parent is the most important thing, but the quality and effort put into the partnership has a substantial effect on the quality of the parenting.