In Matthew, Jesus’ paternal bloodline is presented through Joseph’s heritage. This is done according to Jewish tradition. Jechonias, who was one of Joseph’s predecessors, was so evil that he was cursed by God. In this curse, none of his descendants would sit on the throne of David. This was all recorded so that the virgin birth of the Messiah would be proven to the Jews.
In Luke, Jesus’ maternal bloodline is presented through Mary’s heritage. This was done to present Jesus’s royal lineage and to show the fulfilled prophecies. Mary was a descendant of David’s son Nathan who God had promised he would make the ancestor of the promised king.