Here is a commentary by Ivan Mackovay from the easy English Bible that helps explain the lineage and the importance of it in chapter 3.
Verses 23-38 Jesus began his special work for God when he was approximately 30 years old.
To the *Jews, family history was very important. God had promised to send the *Christ who would be from David’s family. It was necessary to show that the *Christ was a *descendant of David. So, both Matthew and Luke record the family history. Here is an explanation for the two different family lists.
Matthew gives the legal list of names from Abraham to Joseph. In *Jewish law, Joseph was the father of Jesus but in fact, he was not. Matthew starts with Abraham and comes forward in time (Matthew 1:2-16). This shows that Jesus as a man comes from the *Jewish nation. Jesus was the *Christ that God promised to *Israel.
Luke shows that Jesus is not in fact a son of Joseph. So, he gives the list of Mary’s *ancestors. Joseph was the son of Jacob (Matthew 1:16). Heli was his father-in-law (the father of Joseph’s wife Mary). Mary was the daughter of Heli. Probably Luke used the name of the male, Joseph, as it was the custom of the *Jews at that time. The *Jews would not usually end or start the family list with a woman. They would give the name of her husband instead.
Luke shows the family list from Joseph and he goes back in time to Adam. This shows the man Jesus as a relative of all people and not just of the *Jews. God promised Adam that his *descendant would defeat *Satan (Genesis 3:15). This *descendant was Jesus.