Matthew wrote to the Jews so his interest lie with showing Christ’s linage from Joseph. Luke wrote to the Gentiles so his interest lie with showing Christ’s linage from Mary.
The lineage from Luke 3:23-38 is also through Joseph in which Mary is not mentioned. Thus again, how is this relevant given her ostensible virginity?