As we open the pages of the New Testament, the very first words we read deal with the genealogy of Yeshua. Matthew begins: The book of the generation of Jesus Christ, the son of David, the son of Abraham." The Apostle goes on to present a lengthy record that spans the generations from Patriarch Abraham through King David all the way to Yeshua through his "adoptive" father Joseph. Matthew's purpose is clear. He intends to demonstrate that Yeshua is, indeed, ben-David, a descendant of David, and therefore eligible to be the promised Messiah. In addition, the Book of Luke confirms this qualification for the messiahship by tracing Yeshua's genealogy once again to King David, this time through the family line of his mother Miriam (Mary).
One who is not yet convinced of the inerrancy of the Scriptures might question the authenticity of those ancient records. Aside from the total credibility of the Scriptures, which is a separate topic, there are several practical reasons for regarding the records in Matthew and Luke as being accurate.
The first reason is that genealogies held great practical significance for Jews living in the days of the second Temple—the time of Yeshua's birth. The Talmud bears out this fact in the Mishnaic tractate Kiddushin, which deals with betrothals. Chapter 4 of Kiddushin discusses the question of who may contract a betrothal with whom.
Because the Law of Moses forbade the marriage of Jews of legitimate birth to those of illegitimate birth, every Jew would have desired to keep a complete genealogical record. One who could not demonstrate his or her ancestry was legally "neither fish nor fowl." That person could not marry either a known legitimate Israelite or a known mamzer (one of illegitimate birth). The marriage option for such a person was limited to only another person of equally doubtful ancestry.
As crucial as the matter of genealogy was for the common Israelite, it was even more crucial for the kohenim (priests). The purity of God's priesthood was guarded most strictly. A kohen who could not conclusively demonstrate a clear line of ancestry would be presumed to be of "polluted stock," and would be excluded from all of the priestly functions.
Going now to the specific matter of the accuracy of Yeshua's genealogy, we note from Luke 1:5 that Mary's cousin Elisabeth was married to an officiating priest named Zacharias. Kiddushin 4:1 indicates that a Jew who is not of known descent cannot marry a kohen, one of the priestly line. Therefore we must presume that Mary's family genealogy, which included Elisabeth's, had indeed been preserved, and that Luke's account of that lineage is accurate, having been based on those careful family records.
Since, as demonstrated, Mary was obviously of known and pure Israelite descent, we can assume that Joseph, too, was of pure and known Israelite descent. Otherwise he could not have been betrothed to Mary, because Kiddushin 4:3 indicates that a Jew who cannot demonstrate his or her genealogy cannot marry a Jew of known and pure descent.
Some have raised the question: "If, as the New Testament declares, Yeshua was born of Mary while she was still a virgin, how could he inherit the Davidic line from Joseph, who was not his physical father?"
The answer is that in every legal sense of Jewish life, Joseph was Yeshua's father. Kiddushin 4:1 states that a man and wife who live together are presumed to produce legitimate children without the necessity of proof of parentage. Since Joseph and Mary were legally married at the time of Yeshua's birth (and since Joseph had not brought charges of adultery against Mary because of her pregnancy), Yeshua was presumed to be Joseph's legitimate son—not his adopted son.
Of course if Joseph had not been open to God's revelation, the problem of the "mysterious" pregnancy could have held severe consequences for Mary. She might have faced the stigma of being called an adulteress and even risked being stoned, if Joseph had not understood the uniqueness of their situation. But Joseph, being a godly man, did come to understand when the angel told him, "…fear not to take unto thee Mary, thy wife; for that which is conceived in her is of the Holy Spirit." Thus, Yeshua, the virgin-born Son of God, became the son of Joseph in the messianic line of King David.