When Moshe was informed of his imminent passing, Rashi tells us that instead of focusing on his personal needs he busied himself with the needs of Bnei Yisrael. The Torah recounts Moshe's tefilla to Hashem that He appoint a leader to take over the position that Moshe had filled for the last forty years.
Rashi (Bamidbar 27, 16) tells us that Moshe actually had a specific person in mind: He wished that his son would fill the position. Rav Wolbe (Shiurei Chumash) explains that Moshe was not concerned with employment for his child. He felt that it would be beneficial for Bnei Yisrael to have a leader whose approach paralleled that of his predecessor, and thus the best candidate for the position would be one of Moshe's sons.
However, Hashem replied that He had someone else in mind: Yehoshua would be his successor. What did Yehoshua do to deserve the loftiest spiritual position on Earth? Rashi (ibid.) citing Chazal enlightens us to the secret of his success. This merit came as a reward for his constant presence and service in Moshe's tent. More specifically, the Medrash (Bamidbar Rabba 21, 14) tells us that he arranged the benches and spread out the mats for those who came to learn Torah from Moshe Rabbeinu.
Rav Wolbe points out that it is amazing to think about the fact that such a seemingly small act should garner such awesome reward. However, truth be told, every single positive action performed in the spiritual arena merits awesome reward. There are numerous examples found in Chazal. Moreover, many of the actions were performed with ulterior motives and nevertheless earned those who performed them great reward.
Over the course of his encounter with Bilam, Balak offered forty two korbanos. Chazal tell us (Sotah 47a) that in this merit he was rewarded with a descendant, Rus, who was the grandmother of Shlomo who brought thousands of korbanos in the Bais Hamikdosh. Despite the fact that Balak's intention was far from altruistic, he received great reward for his actions. Nevuchadnetzer merited ruling over the entire world because he walked four steps to enhance Hashem's honor. Moshe feared Og, the king of Bashan, because five hundred years earlier he informed Avraham Avinu that Lot had been taken captive. Although his intention behind this superficial act of kindness was the desire that Avraham be killed in battle so that he would be able to marry Sarah, this did not preclude the possibility for great reward.
Sometimes we forget, or perhaps we never realized: a smile, a good word, or Torah learning even for just a minute is worth its weight in gold. Next time we're contemplating opening a sefer or performing a small act of kindness, we should bear in mind the lesson learned from Yehoshua. Every mitzvah planted yields a crop that boggles the mind!