The Torah is here to teach us – its primary purpose is not as a history book or a science text. The Torah is to help us understand our own lives, and connecting them with the lives of our ancestors who connected with each other and with G-d.
Yosef is “given” dreams – the retelling of which get him in huge trouble – almost killed, then sold as a slave, thrown into prison where he rots for years. Why is he given the dreams?
In answering this question, I want to set aside the issue of Destiny. Yes, G-d had told Avraham that his descendants would be servants in a foreign land for four hundred years – but there were a great many ways in which that could have come to be. I think it is better to address matters as the players did: as they came up, without the benefit of hindsight.
We know little about Yosef before the dreams. We know that his mother named him so she could have more sons. We know his father loved him unequally, and “made” him the colored coat. But these are all things that happened “to” him – not things that he chose, or even were innate qualities.
Yosef’s choices, on the other hand, are interesting. He is described as a shepherd amidst his brothers, but a “naar” (“youth”) with the other boys, whom he doublecrosses by telling tales about. And THEN it tells us that his father loved him and gave him a coat – it looks almost like a reward for the loshon hora, the evil talk. Yosef is seemingly taught that telling tales is meritorious.
So here is a thought. I think the first time “naar” is found is Gen. 8:21 “the desires of man’s heart is evil due to his youth.” And later that same verse, G-d says “I will never again continue to destroy,” using the word “Assaf”, which is the root of the same word as “Yosef.” The Torah is connecting the dots for us.
Yosef lives out the earlier verse. When he is a youth, he succumbs to the desires of the young: lording it over his brothers
This occurs, of course, with the very first korban, Noach’s brilliant innovation. G-d is appreciating that man can get it right, even though he does not begin life that way.
So MAYBE G-d gives Yosef the dreams because Yosef represents the archetypal man: yearning toward evil, but not worth destroying the world over. Yosef is chosen BECAUSE he can be a baal teshuva – he starts with the Yetzer Ra, and his name appears in that passuk in Noach. He tells tales. He makes enemies. But like his father, and his father’s father, and the founding passuk, Yosef can make his life a connection – a korban, a coming close to Hashem. In the depths of the prison, Yosef makes the connection, the expression of his faith: “G-d has the interpretations.” And then, despite the bumps in the road, “Miketz”.
G-d gives Yosef the dreams: it is a way to advance both Yosef and his family (not just toward the destiny foretold in the bris bein habesarim, but also, and probably more importantly, spiritually.) Yosef gets the dreams to teach every boy who makes trouble that it is important to learn from the reactions of others, to learn to anticipate how others will hear what you say. To teach us that we are not merely the “yetzer lev” which is evil – we can grow as Yoef does.
“…evil FROM his youth”, doesn’t have to mean from the time of his youth – it could mean DUE to his youth. Meaning because he must start out immature and grow/fix/establish himself, that pupal stage leaves an effect.
Second, Yosef is called a tzaddik for overcoming/conquering/owning his sexual desires. Kabbalistically, it goes deeper than that. It’s perfecting the sefira/middah of Yesod, which is mapped onto the organ of procreation/connection. And the tongue! Yosef starts off with a definite defect in this arena and eventually masters it.
BTW, the zohar and apparently the Torah,too, clearly associate Yosef with the title of Na’ar.