If Joseph was not Jesus’s real father, why is his (Joseph’s) genealogy from David given and not Mary’s? We have no way of knowing if Mary was of Davidic descent or not.
Matthew 1:16 tells us that Jacob was Joseph’s father, while Luke 3:23 says that Eli was Joseph’s father. Even a cursory examination of Matthew’s and Luke’s genealogies of Jesus reveals clearly that these are two different genealogies. Apparently, Joseph was Jacob’s son by birth, and Eli’s son by marriage. Eli, then, was the father of Mary, the wife of Joseph. Matthew 1:6 and Luke 3:32 reveal that both Joseph and Mary were David’s descendants.