Continuing to read the book of Bereshit (Genesis), we observe the Torah’s objective of giving us a rather full picture of our People’s ancestors, including their less glamorous sides. They were human beings like us, with faults as well as virtues, and as such we can realistically strive to emulate their good qualities while learning from their mistakes.
In the middle of the troubling story of Yoseph, the narrative is interrupted by an anecdote about Yehudah, who inappropriately denies his daughter-in-law marriage and ends up being tricked into consorting with her himself. Tradition actually justifies Tamar’s actions, and heavily criticizes Yehudah for all of his. Despite this, none other than King David is their direct descendant!
The sages see David’s sordid lineage as something we must learn from as well. David did not rise to greatness because of his birthright; his greatness was due to what he made of himself. One’s own actions, not their yichus, determines one’s destiny. It is not predetermined.
Indeed, David himself was a complicated character whose tremendously good accomplishments were accompanied by some very troubling ones as well. We should never lose sight of our own good potential while working hard to overcome our shortfalls.