וַיִּשְׁלַח֩ יְהוֹשֻׁ֨עַ אֲנָשִׁ֜ים מִֽירִיח֗וֹ הָעַ֞י אֲשֶׁ֨ר עִם־בֵּ֥ית אָ֙וֶן֙ מִקֶּ֣דֶם לְבֵֽית־אֵ֔ל וַיֹּ֤אמֶר אֲלֵיהֶם֙ לֵאמֹ֔ר עֲל֖וּ וְרַגְּל֣וּ אֶת־הָאָ֑רֶץ וַֽיַּעֲלוּ֙ הָאֲנָשִׁ֔ים וַֽיְרַגְּל֖וּ אֶת־הָעָֽי׃
約書亞從耶利哥打發人到伯特利東邊、靠近伯亞文的艾城去,吩咐他們說:«你們上去窺探那地。»那些人就上去窺探艾城。
Orchot Tzadikim
And if trouble comes, such as famine, plague or other catastrophes, let him always worry lest his sins caused these events — for Achan trespassed in the matter of the dedicated spoils and several thousand Israelites fell because of his fault (Jos. 7:2-22) — and let him return to God, Blessed be He, according to his ability.
Shenei Luchot HaBerit
Of course, their attitude could not be described as pious, although Joshua had acted in a similar fashion prior to the capture of Ai (Joshua 7,2). The difference was that Joshua would not forego the command of G–d just because there were what appeared to be insurmountable natural difficulties. It was not in order for instance, to inquire which route should be taken, since up to now, G–d's pillar of cloud had taken care of that chore, and they had never sent a spy to show them the way in the desert. Even the matter of mountains and valleys was something that the Israelites in the desert did not need to concern themselves with, since the pillar of cloud made their route level, regardless.