One of the important problems is this, in both genealogies in Luke and Matthew, the ancestors are Joseph's ancestors, not Mother Mary's ancestors. Neither gospels give genealogies of Jesus. They are Joseph's. And Joseph is not Jesus' father.
Second important problem is this, in Luke's genealogy, there are 40 generations from Abraham to Jesus (but as I said above, Joseph is not Jesus' father, so the genealogy is Joseph's geneaology). In Matthew's genealogy on the other hand, there are 55 generations from Abraham to Jesus (again in reality it is Joseph's geneaology, not Mary).
Genealogy in Luke is this:
Abraham > Isaac > Jacob > Judah and Tamar > Perez > Hezron > Ram > Amminadab > Nahshon > Salmon and Rachab > Boaz and Ruth > Obed > Jesse > David and Bathsheba > Solomon > Rehoboam > Abijah > Asa > Jehoshaphat > Jehoram > Uzziah > Jotham > Ahaz > Hezekiah > Manasseh > Amon > Josiah > Jeconiah > Shealtiel > Zerubbabel > Abiud > Eliakim > Azor > Zadok > Achim > Eliud > Eleazar > Matthan > Jacob > Joseph (Joseph is not Jesus' father) Jesus
Geneaology in Matthew is this:
God (God is nobody's father) Adam > Seth > Enos > Cainan > Maleleel > Jared > Enoch > Mathusala > Lamech > Noah > Shem > Arphaxad > Cainan > Sala > Heber > Phalec > Ragau > Saruch > Nachor > Thara > Abraham > Isaac > Jacob > Juda > Phares > Esrom > Aram > Aminadab > Naasson > Salmon > Boaz > Obed > Jesse > David > Nathan > Mattatha > Menan > Melea > Eliakim > Jonam > Joseph > Judah > Simeon > Levi > Matthat > Jorim > Eliezer > Jose > Er > Elmodam > Cosam > Addi > Melchi > Neri > Salathiel > Zorobabel > Rhesa > Joannan > Juda > Joseph > Semei > Mattathias > Maath > Nagge > Esli > Naum > Amos > Mattathias > Joseph > Jannai > Melchi > Levi > Matthat > Heli > Joseph (Joseph is not Jesus' father) Jesus
The difference between 40 generations and 55 generations from Abraham to Jesus proves one thing: These genealogies are forgeries. Neither author knew Mary's genealogy and they just forged some genealogy for Jesus' stepfather.
It has crucial importance to attribute Jesus' ancestry through his mother because he was created without a father-mother relation. Instead, carelessly enough, the authors of Matthew and Luke attribute Jesus to Joseph.
One is for Joseph and the other is for Mary. No problem at all.
Both of them are Joseph's. You are blind.