Miketz [After]
Rabbi Shimon said, “Until that event happened to Joseph, he was not called ‘righteous.’ Once he kept that covenant, he was called ‘righteous’ … And what happened in the pit before, they moved away from it, and it is written, ‘and they hurriedly brought him out of the pit,’ he was removed from it and was crowned in a well of living water.”
He interprets in the Sulam [Ladder commentary on The Zohar] that this should not be perplexing because through this act, he was rewarded with being called a “righteous.” Thus, why did they place him in the prisoners’ dungeon? He replies that he was initially in the pit because through it he ascended to kingship. It is written, “and they hurriedly brought him out of the pit,” meaning he moved away from it, from the Klipa [shell/peel], and was crowned with a well of living water, which is the Shechina [Divinity] (The Zohar, Miketz).
We should ask why it was necessary to first be in prison, which is called Klipa [shell/peel], in order to ascend to Kedusha [holiness]. As soon as he was called “righteous,” by that deed, he should have entered the Kedusha. And yet, we see that Joseph was in the pit twice—1) by his brothers, as it is written, “And they threw him in the pit,” 2) by the chief cook, as it is written, “and they hurriedly brought him out of the pit.”
We should say that a pit means prison, that it is a person being under the control of the evil inclination, when one is incarcerated by it and cannot emerge from its authority.
By observing the Mitzva [commandment] of honoring the father, Joseph saw through the illumination of the Mitzva that he was in prison, since during the darkness it is impossible to see the truth. But that was only through his brothers, who are Israelis. That is, he saw that he was walking in the path of the Creator, but the reason that makes him work is the environment, that he is in an Israeli environment.
It follows that he was incarcerated by the environment, meaning had to engage in Torah and work because of the environment. When a person is rewarded with greater light, he sees the truth, that he is not in the prison of Israel, but he is truly in the hands of the Klipa.
The fact that he was called “righteous” because of the deed, at that time he saw that it was Potiphar who placed him in prison, and saw that it was a real Klipa. At that time, there is room for prayer that the Creator will deliver him from prison.
The more one sees that he needs the Creator’s help not for luxuries but for necessities, the more genuine is the prayer. Therefore, it is accepted above and the Creator delivers a person from imprisonment and is rewarded with being among the recipients of the face of the Shechina [Divinity].
This is the meaning of the words of The Zohar, “And what happened in the pit before was removed in a well of living water,” as it is written in the Sulam [Ladder commentary on The Zohar], “and they hurriedly brought him out of the pit,” meaning he moved away from this Klipa and was crowned in a well of living water, which is the Shechina.