There are many purposes for presenting the genealogy of Jesus in the Gospels, chief among them which is the affirmation that Jesus, being in truth the Son of God, as all Gospels testify, has come “in the flesh” as a real human being.
…One other important point is made in listing the human generations which led to the birth of Jesus. This is the fact that God is faithful to his promises even though his chosen people are often not faithful.
Among the people from whom Jesus came are both sinners and heathens. In a word, Jesus comes not only from the righteous and holy, but from the wicked and sinful. And he comes not only from Jews, but from Gentiles.
+ Protopresbyter Thomas Hopko, The Winter Pascha
