The Claim: The genealogies in Matthew and Luke contradict one another.
Matthew and Luke trace the descent of Mary’s husband Joseph from King David via two completely different sets of ancestors, 25 of them in the case of Matthew, 41 in Luke. To make matters worse, Jesus was supposed to be born of a virgin mother, so Christians can’t use Joseph’s descent from David to establish that Jesus was descended from David.
Dawkins, Richard. Outgrowing God (p. 29). Random House Publishing Group. Kindle Edition.
Do the Genealogies contradict one another?
The Gospel genealogies in Matthew and Luke might appear contradictory on the surface, but in reality, they are complementary.
The genealogies are consistent from Abraham to David. But, from David on, they differ. They also begin in different places.
Matthew’s genealogy goes from Jesus to Abraham. Matthew does this to emphasize Jesus’ Jewishness, as Abraham is the father of the Jewish nation. Matthew follows the line of Solomon, who is a son of David.
Luke’s account goes back to Adam, the father of the human race. This focus, of course, emphasizes Jesus’ humanness and the universality of his message. Luke traces his line through Nathan, also a son of David.
One explanation for this is that one is a genealogy for Jesus through Mary, and the other is a genealogy through Joseph.
The beginning of Matthew’s story focuses on Joseph and his dream. Luke focuses on Mary and the angel speaking to her. It would make sense that they would trace the genealogy of the person on whom the beginning of their story focuses.
Another plausible explanation is that Matthew is giving a royal genealogy. He is providing an account of the descent of the legitimate kings of Israel and not necessarily Joseph’s actual line of ancestors. He is then showing that Joseph is related to this line. It appears Luke is giving Joseph’s direct ancestors.
It is not a problem if Joseph is used in Jesus’s genealogical account as he would have officially been Jesus’ father.
We are not entirely sure which of these two theories (and there are more) are correct. However, these are both reasonable explanations for why the two accounts differ. A flat statement that the two are irreconcilably different would not stand up to scrutiny. This is so especially considering the fact that one would have to explain why, if this is such a glaringly obvious contradiction, both accounts would make it unaltered into the canon.
There is also the caveat that genealogies at this time were not exhaustive as we would expect them to be today.
The below vides are helpful for further explanation.