The gemara says חמישים שערי בינה נבראו בעולם וכולן ניתנו למשה חסר אחת, fifty gates of understanding were created in the world; all were given to Moshe except for one. Why does the gemara phrase it this way, instead of simply stating that Moshe received forty-nine gates?
The Shelah teaches that Moshe Rabbeinu learned the Torah in its entirety, including the shaar nun, the fiftieth level of wisdom. When he ascended Har Sinai, no aspect of Torah was withheld from him.
However, following the sin of the eigel, golden calf, Moshe lost the fiftieth level. Hashem said to him, לך רד, go down. The word לך has a gematria of 50, indicating that Moshe was being told to descend from the fiftieth level. Now, he had only forty-nine levels of Torah. This answers our question as Moshe originally received all fifty gates. Only afterward, following the sin of the eigel, did he lose one.
At the end of Moshe’s life, the Torah relates, ויעל משה מערבת מואב אל הר נבו, Moshe ascended from the plains of Moav to Har Nevo. Moshe ascended from the plains of מואב, whose gematria is 49, symbolizing the level at which he stood throughout his life after the eigel. Now, at the very end, he ascended once more toward the fiftieth level.
The name of the mountain, נבו, is understood as נ' בו, the fiftieth level is within it. This hints that the fiftieth gate was returned to Moshe before his passing, and he once again possessed all fifty levels of Torah.
The Chassam Sofer writes that Moshe’s student Yehoshua is specifically called יהושע בן נון, Yehoshua bin Nun, rather than ben Nun. The word bin relates to binah. Yehoshua had contemplated the שער הנון, the fiftieth level of Torah, which he had learned from his rebbi, Moshe Rabbeinu before it was lost through the sin of the eigel.
Moshe brought the fiftieth level of Torah into the world. Though he lost it after the eigel, R' Akiva later accessed it, and transmitted it to R' Shimon bar Yochai. The Torah of the shaar nun was ultimately recorded in the Zohar, and it is this dimension that makes the Zohar singular and unique.