Torah Raised Him
Chazal teach that Yehoshua was elevated only because he engaged in Torah study continuously, from childhood to old age. Seeing how precious the words of Torah were to him, Hashem told him that this sefer haTorah would not leave his mouth.
Source: Mishnas Rebbi Eliezer 13; Menachos 99b; Tanna d’Bei Eliyahu Zuta 13; Sefer Yehoshua 1:8