When the Tree of Knowledge of Good and Evil comes up, most of my Bible resources defer. Its existence is problematic because it assumes that God's good, blessed, and sanctified creation can include evil. At least at a conceptual level--perhaps embryonic or dormant--evil took residence in a God-designed, God-approved creation.
To be fair, humanity made the objective concept a subjective reality. Not until Eve was goaded by the serpent and Adam complicit in breaking the one prohibition, was evil activated. Humanity is to blame.
Nonetheless, human culpability does not answer the question: Why pair good with evil in the first place? Hence, commentator's deference.
Genesis, though, may hint at a resolution. As the narrative races us through the country of good and evil--family squabbles and faithful promises; fratricide and fertility; floods and rainbows; covenants and curses; stolen birthrights and spiritual blessings--it returns to the curious pair of terms from the prohibited garden tree. Joseph mentions good and evil as a summary of his tumultuous life.
"As for you, you meant evil against me, but God meant it for good, to bring it about that many people should be kept alive, as they are today" (Genesis 50:20).
Joseph had lived as a favorite son and slave, exalted servant and criminal, only to land as Pharaoh's second-in-command. Speaking to the very brothers who betrayed him, but now begged bread, Joseph offered forgiveness (50:19). Moreover, he provided rational for the existence of evil. What man activates for evil, God redeems for good.
Joseph does not speak solely for his life, but for every life. Evil exists because God uses it for redemption. And redemption is a better story.