Gemara: "Moshe would take the tent and erect it outside the camp … and Hashem would speak to Moshe face to face" (Shemot 33: 7,11) "… and he returned to the encampment" (ibid.). Rav Avahu expounded: Hashem said to Moshe: "Now they will say that the teacher is angry and the student is angry, what will be with them? If you return the tent to its place, fine, but if not, your student Yehoshua Bin Nun will serve in your stead." That is what the Torah means by "he returned to the encampment." Rava said: Even though [he returned], the matter did not go without impact, as the pasuk says: "And his assistant, the lad Yehoshua Bin Nun did not depart from the tent" (ibid.).
Ein Ayah:The dor hamidbar (the generation of Israelites who lived in the wilderness after the Exodus from Egypt) before the sin of the Golden Calf was fit to be led by Moshe. However, when they fell from their level due to the sin, Moshe thought that they needed to be pressured, to raise them back to the level at which they had been previously.
However, it was clear to Hashem that it was not possible to elevate them to that extent in one step. Hashem, therefore, knew that it was necessary for Moshe to lower his style of leadership to the nation’s level. Even when acting on that lower level, the fact that the leadership came from Moshe, who was fit to lead them on their higher level, made it possible for that leadership to return them over time to their previous level of completeness.
However, had Moshe not agreed to change his leadership according to what the people were able to accept, it would have been necessary to change the style of leadership through the introduction of Yehoshua. Had Yehoshua become the leader, then the leadership would have been limited to his level. It would not have been possible to return to the original lofty level that Moshe’s leadership could have produced. Moshe’s leadership was on a higher level, even when it had to contain external elements of a lower level. Moshe’s leadership contained great elements that were capable of returning them to greatness, as will actually occur in the future. It is for that reason that Moshe returned to the encampment, as he was concerned about the loss of hope for a more complete future.
That which was gained by Moshe’s continued leadership remains. The dor hamidbar was an inaugural generation for the People of Israel and embedded in it were the essence of future generations. The spiritual gains that were rooted into the dor hamidbar will find proper expression when souls will be completed over time. It was necessary to "plant the light" of a higher level of action, which will be exhibited later.
The fact that Yehoshua took part in the leadership of Moshe enabled him to do a proper job as the main leader of the generation that entered Eretz Yisrael. There he had to use his own characteristics and employ the level fitting for future generations. Yehoshua’s basic leadership trait was related to the world of physical actions performed so that the world can function naturally in the proper manner. Had Moshe not accepted his modified leadership, Yehoshua’s natural leadership would have to had begun immediately, but as it is, it was delayed until the people entered the Land, when the people "lowered" their way of life to natural existence. In truth, though, there is an elevation that comes from lowering oneself into matters of the physical world and the natural means of action, and this is the desired goal of Israel as a national entity and as human beings.