The Messiah is prophesied to have a virgin birth. Given that, his ancestry would come through his mother’s father or indirectly through his adoptive father. We are given two genealogies, one in Matthew 1 and one in Luke 3. Both of these genealogies appear to come through Joseph, His adoptive father. However, in Luke 3:23 Joseph’s father is Heli, but in Matthew 1:16 Joseph’s father is Jacob. They can’t both be right without some explanation for this variation.
One explanation would be that the Joseph in Matthew 1:16 is not the same Joseph mentioned in Luke 3:23. The best explanation I see at the moment is the Joseph in Matthew is Mary’s father. Mary’s father and her betrothed have the same name.
However, that explanation implies that there is something wrong with the Greek text of Matthew 1:16 from which our translations were made. If the Bible is inerrant it means the word ἄνδρα (husband) is a copying error from some earlier manuscript that could be translated as father. Is there evidence for such an earlier manuscript?
As Nehemia Gordon points out in the video below there are Hebrew manuscripts of the genealogy of Matthew with Joseph being the father, not husband, of Mary.
There are other explanations that could account for this such as Danny Zacharias’ explanation that all names were not included, but his explanation brings up another puzzle that there are only 13 generations between the Babylonian captivity and Mary when 14 were claimed to be there. This count would be resolved if the Joseph mentioned in Matthew were Mary’s father.