Hate to quibble here, but the term used is that one of David's descendants would be the one - which the Jews regularly used to include legitimate as well as illegitimate offspring. Since the principal wife of the hareem was the legitimate one, all other male offspring were normally recognized in some fashion or other. They were not simply cast off. And were recognized as descendents. But not heirs.
Inheritance could not be passed on through the mother as the mother did not have the spérma.
Wealth and the distribution of it to the next generation was and is of concern to those who have it.
Point well taken, Mark. However, the right to the throne could not be passed on to the descendants of concubines. Only the legitimate decadent can claim the throne, and be the anointed one [i.e. the Heb. mashiyah, Eng. messiah, Gr. christos]. And the messiah is the warrior-king in Judaism, of Davidic line of inheritance, a royalty by direct descent and entitlement to the title of king.
Such inheritance is not matrilinear, so Mary's pedigree is irrelevant as to his being the anointed king of Israel by birthright, except to Jesus' Jewishness. And Joseph's lineage is irrelevant because his branch did not have the right to the title, and because he was not the father of Jesus, so his pedigree, although listed, is a pointless smoke screen.
Remember, Matthew writes to the Jews and is pursuing a mumbo-jumbo Joseph's pedigree, as if Joseph was the father, and knowing that patrilinear inheritance is the only one the Jews would even take as worthy of consideration.
This flies in the face of what follows, considering that as soon as he is done with Joseph's genealogy, Matthew makes it clear that Joseph is not the physical father of Jesus! So, why go through that genealogical charade?
Luke, on the other hand, writing to the Greeks ignorant of the Jewish customs, is grasping at the straws to establish legitimacy via Mary's genealogy, but all he really mnages to establish is Jesus' Jewishness, and not his legitimate royal inheritance.