7 “But whence is it manifest that He is of David?” one may say. For if He was not sprung of a man, but from a woman only, and the Virgin has not her genealogy traced, how shall we know that He was of David's race? Thus, there are two things inquired; both why His mother's genealogy is not recited, and wherefore it can be that Joseph is mentioned by them, who has no part in the birth: since the latter seems to be superfluous, and the former a defect.
Of which then is it necessary to speak first? How the Virgin is of David. How then shall we know that she is of David? Hearken unto God, telling Gabriel to go unto “a virgin betrothed to a man (whose name was Joseph), of the house and lineage of David.” What now would you have plainer than this, when you have heard that the Virgin was of the house and lineage of David?
Hence it is evident that Joseph also was of the same. Yes, for there was a law, which bade that it should not be lawful to take a wife from any other stock, but from the same tribe. And the patriarch Jacob also foretold that He should arise out of the tribe of Judah, saying on this wise: “there shall not fail a ruler out of Judah, nor a governor out of his loins, until He come for whom it is appointed, and He is the expectation of the Gentiles.”
“Well; this prophecy does indeed make it clear that He was of the tribe of Judah, but not also that He was of the family of David. Was there then in the tribe of Judah one family only, even that of David, or were there not also many others? And might it not happen for one to be of the tribe of Judah, but not also of the family of David?”
Nay, lest you should say this, the evangelist has removed this suspicion of yours, by saying, that He was “of the house and lineage of David.”
And if you wish to learn this from another reason besides, neither shall we be at a loss for another proof. For not only was it not allowed to take a wife out of another tribe, but not even from another lineage, that is, from another kindred. So that if either we connect with the Virgin the words, “of the house and lineage of David,” what has been said stands good; or if with Joseph, by that fact this also is proved. For if Joseph was of the house and lineage of David, he would not have taken his wife from another than that whence he himself was sprung.
“What then,” one may say, “if he transgressed the law?” Why, for this cause he has by anticipation testified that Joseph was righteous, on purpose that you might not say this, but having been told his virtue, might be sure also that he would not have transgressed the law. For he who was so benevolent, and free from passion, as not to wish, even when urged by suspicion, to attempt inflicting punishment on the Virgin, how should he have transgressed the law for lust? He that showed wisdom and self-restraint beyond the law (for to put her away, and that privily, was to act with self-restraint beyond the law), how should he have done anything contrary to the law; and this when there was no cause to urge him?
Source: Homilies on the Gospel of St. Matthew (New Advent)