and Jacob the father of Joseph the husband of Mary, of whom Jesus was born, who is called Christ.
Jesus, when he began his ministry, was about thirty years of age, being the son (as was supposed) of Joseph, the son of Heli,
The Claim: Joseph had 2 different fathers. How is that possible?
The Explanation: In order to understand the matter at hand, we need to know some more things about the lineage Matthew and Luke traced. Matthew traced the lineage through Joseph, while Luke traced the lineage through Mary, which can be logically deduced by a prophecy from Jeremiah.
If you examine the full lineage of Matthew (1:2-16) and Luke (3:23-38), you'll notice that the point of differentiation is not Heli and Jacob, but Nathan and Solomon, the two sons of King David.
Matthew is tracing the lineage through Jeconiah, who is mentioned in Matthew 1:12. In Jeremiah 22:28-30, a prophecy is given that "none of his offspring shall succeed in sitting on the throne of David and ruling again in Judah." (verse 30) Fortunately, Jesus was born of a virgin, which avoids this potential problem. Another thing to note is that Jeconiah comes from the line of Solomon, son of King David.
Luke on the other hand, traces the lineage through Mary. This is evidenced through the fact that Luke's lineage (Luke 3:23-37) does not mention Jeconiah at all, and the prophecy of Jeremiah 22:28-30 still stands. Now Heli came from the line of Nathan, the other son of King David. Nathan is not mentioned in Matthew's line, and Solomon was not mentioned in Luke's line. In relation to the prophecy regarding Jeconiah, Mary was not from Jeconiah's line, because Jeconiah came from the line of Solomon, whereas Mary came from the Line of Nathan.
Now to answer the question, "how can Joseph have 2 fathers?" The answer from this point is quite simple. When Joseph married Mary, Heli became Joseph's father-in-law, while Jacob remains the biological father of Joseph, according to Matthew 1:16. There is no contradiction here.