There are two genealogies of Jesus listed in the New Testament, in Matthew and in Luke, and they are not quite the same. A common explanation for this is that one is the genealogy through Joseph, Jesus' earthly father, while the other is through Mary, his mother.
Perhaps this is the case, but the problem I see is that the wording does not seem to suggest that either genealogy is through Mary. It seems to be saying that both genealogies are through Joseph.
So, I think they are both through Joseph.
But how can this be?
I think that when Joseph was young, his father - or father and mother - died. Then, either his mother remarried or, if she had also died, Joseph was adopted. (In support of this speculation, Joseph apparently died fairly young, as we hear nothing about him in Jesus later life, so perhaps Joseph suffered from a hereditary disease that also afflicted his birth father.)
Anyway, this would mean that one genealogy was through Joseph's birth father, and the other through Joseph's stepfather, or adopted father.