As Moshe approached his last days on earth, he asked G-d to designate his successor, to lead the Jewish people into the promised land of Israel, fight the wars of conquest, and settle the people in the land. G-d chose Moshe’s loyal student, Yehoshua (Joshua). Yehoshua was chosen, explains the Medrash, because he would set up the benches and mats for the students who would come to listen to Moshe teach them Torah.
Yehoshua had many other fine attributes, and it seems odd that his custom of setting up the classroom would make him the best candidate for the next leader of Israel. The undertaking was thoughtful to be sure, but how did this quality prime him for leadership?
When Yehoshua would prepare the benches for the students, he was thinking, “The students are coming to learn Torah. What could be more special than that? I want to make sure they don’t need to waste time setting up their seats, so that they can begin their studies right away. Torah study is so important, they shouldn’t lose a moment of time!” The fact that they were only the students, and not the teacher, did not prevent him from respecting their purpose. This demonstrated that his motivation was pure, and the primacy of Torah study was his focus.
It was this respect for the Torah, the word of G-d, that made Yehoshua the leader of the Jewish people. The Jewish nation is led by G-d and His Torah, and Jewish leaders must be driven by complete fealty to its words. (based on Taam V’Daas from HaRav Moshe Shternbach)