People massage their lineage by scrubbing some from the family tree (don’t mention great-grandfather that was the village idiot or other unsavory characters.
Matthew, however, when listing the family tree of Jesus, doesn’t scrub clean or try to hide anything from the line. So, he begins with Abraham and recounts generation to generation of real flesh and blood of not so perfect people that lead to Jesus called Christ. There are kings, faithful, righteous but also liars, adulterers, manipulators, murderers
Why do it? Why tell all? Because it’s true. Matthew is presenting a true picture of what really happened. He is not writing a fairy tale but giving an historic account. Looking at the lineage we see who Jesus came from and who He came for.