And Jesus himself began to be about thirty years of age, being (as was supposed) the son of Joseph, which was [the son] of Heli,
Note 1 at Lu 3:23: The genealogy in Matthew is from Abraham to Jesus, while the book of Luke traces Jesus' ancestry from Jesus all the way back to Adam. The genealogies are the same from Abraham to David, but from David to Jesus, they are totally different. Both these genealogies were accepted by the early church despite their differences, which is proof enough of their accuracy.
It appears that Matthew traced David's line through Solomon (Mt 1:6), while Luke traced the royal lineage through Nathan (Lu 3:31), another son of David (2Sa 5:14). This would bypass the curse on Jechonias' seed (Jer 22:24-30).
The justification for two genealogies is that Matthew recorded Joseph's line, while Luke recorded Mary's line. Luke did say Joseph was the son of Heli, making it appear that Luke was also tracing Joseph's lineage, but that would not have to be the case. There is scriptural precedent for a man's son-in-law to be reckoned to the daughter's genealogy if her father had no sons (Nu 27:1-11 and 36:1-12 with Ru 4:6). This could explain the substitution of Joseph's name for Mary's in Luke's account. This is especially appropriate, since Jesus was the seed of the woman (Ge 3:15) and not the seed of man.