Jesus would have had Mary's DNA, and not Joseph's. Joseph was of the line of David -- there is no evidence that Mary was. In fact, there is some evidence that Mary came from a Levitical family. Her sister was married to a priest.
The genealogy in Luke 3 would seem to be of Joseph's bloodline, while that in Matthew 1 records in chronological order those who inherited the royal office (passing, for example, from uncle to nephew when the uncle was without heirs).