Correct; no legalities involved.
The term used is "seed" (John 7:42, Gr. σπέρμα, spérma; also Ps 89:4, Heb. zera') and seed implies patrilinear inheritance, which is synonymous with legality.
Of course, women were believed to have no "seed". The Jews believed that the woman is a "fertile field" on which man's "seed" (a term synonymous with offspring or descendants) would grow.
This is how the term "barren" or "infertile" originated for women who could not get pregnant. As long as man produced "seed" the "fault" was woman's. So much for bible-based "science" under spiritual guidance.
In Romans 1:3 Paul clearly states that (he believed) Jesus was the product of patrilinear Davidic line:
Inheritance could not be passed on through the mother as the mother did not have the spérma.
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.