Doesn't it make sense to say that the Gospel of Luke gives Mary's genealogy, since it would be nonsense to go through Joseph's line if he is not the biological father of Jesus?
It should be noted that the Gospel of Matthew sets the precedent for presenting a genealogy of Jesus that goes through Joseph. Incidentally, this genealogy goes through a line (Jehoiakim) that is disqualified for kingship. Therefore, it is not surprising that Luke's genealogical list also gives a genealogy (much different from that given by Matthew), which is supposedly that of Joseph.
The Gospel of Luke provides a variant tradition concerning Jesus' ancestry. In the literal Greek of its genealogical listing "Joseph of the Heli" (Luke 3:23) is just another way of saying "Joseph son of Heli."
Some Christian commentators have claimed that Luke gives Mary's genealogy. Accordingly, it is proposed that Heli is the father-in-law of Joseph, that is, Heli is the name of Mary's father. There is no genealogical record, in either the Jewish Bible or the New Testament, which refers to a man as the son of his father-in-law. There is no verse in the New Testament that says Mary is the daughter of Heli.
To presume that Mary was of Davidic descent presents the problem that Mary could not pass on what she did not possess: (1) Maternal connection does not enter into consideration for succession to the throne of David which is passed on only through a continuous male line: "There shall not be cut off from David a man to sit upon the throne of the house of Israel" (Jeremiah 33:17); (2) Biblically, the right of lineal privilege, that is, kingship and priesthood, are exclusively passed on through the male line. The incident regarding the inheritance of the daughters of Zelophehad (Numbers, chapters 27 and 36) does not apply here since it concerns the transference of physical property and not privileges of lineage.
Considering Luke's genealogical list, neither Joseph nor Mary could claim an inheritance to the throne of David through Heli. Heli and his progeny would be disqualified in regard to the Davidic kingship if he were a descendant of Nathan. Of all the son's of David, God chose Solomon to sit on the throne of Israel (1 Chronicles 29:1, 1 Kings 2:24).
Whether through Joseph or Mary, Jesus is disqualified from the messianic office.