Bamidbar Rabbah (21.14)
“May the Lord, God of the spirits of all flesh, appoint a man over the congregation” (Numbers 27:16).
“Moses spoke to the Lord, saying: May [yifkod] the Lord, God of the spirits…appoint” – anyone who pleads for the needs of the public, it is as though he comes by right.
“The Lord shall appoint” – what did he see that led him to request this matter after the order of inheritance?
It was since Tzelofḥad’s daughters inherited from their father, Moses said: This is the moment for me to demand my needs. If the daughters inherit, it is only fitting that my sons inherit my prominence.
The Holy One blessed be He said to him: ‘“The guardian of a fig tree will eat its fruit” (Proverbs 27:18) – your sons sat idly and did not engage adequately in Torah study.
Yehoshua administered you very extensively and accorded you great honor, and he would come early and stay late at your house of study. He would arrange the chairs and spread the mats. Because he served you with all his might, he is worthy of serving Israel, as he will not be deprived of his reward.’
“Take for you Joshua son of Nun” (Numbers 27:18) – to realize what is stated: “The guardian of a fig tree will eat its fruit.”