It’s not far off from the Old Testament command for a man to marry his brother’s childless widow and raise up children for him - a sort of regrafting. And it makes sense from a material, evolutionary point of view. A son would carry the Y chromosome - the only guaranteed genetic inheritance through the generations is the Y chromosome in the male line, or the mitochondrial DNA in the maternal line.
Not that they are guaranteed a son. Not that it is right, or un-icky. But it makes a lot of sense.
Mrs VS
Even a daughter would carry 50% of the father's genetics.
It’s almost exactly what happened with Judah and Tamar (Genesis 38), except Judah didn’t quite realize what he was doing...