If there are two presumed fathers then isn’t there an obvious dispute?
At the hospital, the staff will write the name of the woman’s husband on the birth certificate if no one says anything. I know when my children were born no one was asking who the biological father of the baby was or asked me to confirm that I was the father, I was just assumed to be the baby’s father.
It would depend on the exact way that a particular state’s laws were written. But generally whoever gets written on the birth certificate will become the legal father if no steps to dispute paternity are taken. So if a woman shows up at the hospital with her husband, but the baby’s father is potentially her ex-husband’s, then we use Science to determine the legal father of the baby. Or, the three adults involved decide who the legal father of the baby will be. If the three of them agree on a story, or passively go along with the story that everyone else is telling, then there is no dispute and the legal father of the baby will be whoever is asserted to be the father.
Again, the point is that hospitals do not do routine paternity tests before writing the name of the father on the birth certificate. They take your word for it. And society has no interest in prying into the details. We want babies to have legal fathers, so anyone who claims to be the father is good enough for us. We don’t care who the biological father is, we just want someone to raise this goddam baby. Now, we don’t assign paternity at random. But if your wife was fucking some other dude, and you don’t want to raise that other dude’s baby, it’s your lookout to make sure that doesn’t happen, we’re not going to bring it up unless you bring it up.
And we also have the concept of finality. The child’s parentage is not up for debate once it’s settled. The child’s parentage is not a biological matter, it is a legal matter. It is well established that children can be adopted. So you can’t adopt a child, and five years later demand a paternity test and when it comes back that the child isn’t genetically yours send the kid back to the orphanage. Same thing with the baby your wife had. That’s your baby, regardless of if you later find out that your wife fucked another dude. You do have a window to dispute paternity, just like you don’t have to adopt a child. But if you accept the child as yours then that’s permanent, regardless of biology. Excepting of course, the various ways that parents can lose parental rights for their children.
But note that generally even if you beat your kids or are in jail or do all kinds of horrible things you are still the legal parent of the child, and the child cannot be adopted without your consent. You can lose the right to have the child live with you, the kids might be in foster care while you’re in jail or in rehab or on the streets, but the kids can’t be adopted without your consent.