The Messiah and Joseph's genealogy?
Both Matthew and Luke record the genealogy of Yeshua from different perspectives. Matthew's gospel gives us the legal lineage of Yeshua, while Luke gives us the bloodline.
Matthew's focus is on Yeshua the son of David, the son of Abraham; thus the lineage of Yeshua in Matthew's gospel runs forward from Abraham, through DAVID, down the line of the kings of Israel (Solomon, Rohoboam, Abijah, etc.) down to Joseph who is of the royal lineage of David.
Luke's gospel, however, begins with Yeshua and moves backward to the man thought to be his father, Joseph, then to Heli (Mary's father), back through the bloodline to one Nathan, who also was a son of David, but was never the king. This genealogy continues all the way back to Adam.
Though this Nathan was of the royal household (also a son of DAVID), he was not of the royal line of those who sat as king over Israel. As it turns out, in the royal lineage, the line of kings through DAVID was cursed by God owing to the sinfulness of one Jehoiachin (a.k.a., Jeconiah, a.k.a., Coniah). God swore that, after Jehoiachin, there would be no offspring of that line to sit upon the throne of DAVID (see Jeremiah 22:24-30).
Even though the royal lineage of DAVID was now permanently barred from sitting on the throne of David to rule over Israel, there is no mention of the bloodline itself being barred from such service. Enter Nathan...
Nathan was one of four (4) sons born of Bathsheba in Jerusalem (see 2 Samuel 5:14 and 1 Chronicles 3:5). Precious little is known of Nathan other than those two blurbs in the OT and Luke's account of the genealogy of Yeshua. But one thing is for certain, Nathan never sat upon the throne of DAVID, thus, he was never the king, thus he is unaffected by the kingly line being cursed. If you are not the king, you are a servant. You may be a high-ranking servant, but a servant nonetheless.
Nathan provides the perfect nexus between the prophecies that Messiah will sit upon the throne of DAVID, and that default of Jehoiachin. While Satan had worked so tirelessly to bring the line of DAVID to an end, God had, from the beginning, prepared a flanking maneuver whereby Messiah would come, strong and hard, through the line of DAVID, via Nathan, the son of DAVID and Bathsheba.
I find it interesting (simply as a side note) that Messiah is often referred to as God's servant. This, too, is in perfect keeping with Yeshua coming through DAVID via Nathan (a servant, not the king). Yeshua's time of being a servant is fulfilled. When next he appears on the scene, it will be as King of kings, and Lord of lords; the Sovereign of the universe.