Why does the bible trace Jesus lineage through Joseph?
The genealogies in Matthew and Luke are fabrications, so you can’t tell anything factual from them. Each of those writers wanted to show that Jesus was descended from David, so they separately made up the respective genealogies. That is why they contradict each other. They each provided their fabricated genealogies as showing the descent from David through Joseph, which would have been according to the legal descent, since Joseph was the husband of Mary. Since the genealogies are contradictory, some Bible apologists try to say that the genealogy in Luke is actually that of Mary. However, Mary is not even mentioned in that genealogy. If that genealogy was that of Mary, why doesn’t her name appear in it? In any case, according to Luke, Mary was Elizabeth’s cousin (suggenes in the original Greek, which indicates a blood relative). Since Elizabeth was of the priestly tribe of Levi, Mary would also have been of that descent and could therefore not have been a descendant of David. That is, i