Why does Matthew trace Abraham’s geneology to Joseph, when he is not Jesus true father?
Matthew traces the genealogy of Jesus from Abraham, the father of the Jewish nation, through David, the King of Judah to whom God made the Davidic covenant. This shows Jesus in the line of Abraham and David, but Matthew does not say that Jesus is the actual son of Joseph—only that he is in the Messianic line through Joseph. By implication, he is the legal son of Joseph by adoption. Actually, in 1:16 he said, “and to Jacob was born Joseph the husband of Mary, by whom (in the Greek text, the pronoun “whom” is feminine and refers only to Mary) was born Jesus, who is called Christ (the Messiah).”
But this is not the end of the story. Luke traces the lineage of Jesus from Adam to Mary through Nathan (see Luke 3:31), not Solomon as with Joseph, to stress the true humanity of Jesus as the Son of Man, as One who can feel for our needs. Mary too is in the Messianic line as a descendent of David and this makes Jesus the physical son of David and in the Messianic line. Note that Luke starts the genealogy with these words, “And when He began His ministry, Jesus Himself was about thirty years of age, being supposedly the son of Joseph.” He then goes on to show that Jesus was the grandson of Eli through Mary. Eli was Mary’s father (3:23).
For more information on the miraculous element of this genealogy see the studies on Prophecies of the Birth of Christ on our site at www.bible.org. Also, check out the Concise NT Survey particularly the introduction to the historical books section. I might also suggest two books by Josh McDowell, More Than a Carpenter, and Evidence that Demands a Verdict, Living Books, Tyndale House.