וַיָּשֻׁ֣בוּ אֶל־יְהוֹשֻׁ֗עַ וַיֹּאמְר֣וּ אֵלָיו֮ אַל־יַ֣עַל כָּל־הָעָם֒ כְּאַלְפַּ֣יִם אִ֗ישׁ א֚וֹ כִּשְׁלֹ֣שֶׁת אֲלָפִ֣ים אִ֔ישׁ יַעֲל֖וּ וְיַכּ֣וּ אֶת־הָעָ֑י אַל־תְּיַגַּע־שָׁ֙מָּה֙ אֶת־כָּל־הָעָ֔ם כִּ֥י מְעַ֖ט הֵֽמָּה׃
E ritornarono da Giosuè e gli dissero: «Non salga tutto il popolo; salgano circa duemila uomini o circa tremila uomini, e colpiscano Ai; non affaticare là tutto il popolo, perché essi sono pochi».
Or HaChaim
Spies may have more than one mission then. 1) They have to find out the best approach to invade a country. They also have to determine if the whole army has to be involved in the campaign or if it suffices to send a relatively small number of troops. We find evidence of this in Joshua 7,3 where the spies told Joshua that 2-3000 soldiers would be enough to capture the town of Ai. This kind of spying, or reconnaissance in our language, would be repeated each time a specific target such as a town was to be captured. 2) The other kind of spying involves something of a more comprehensive nature. The spies' mission is to evaluate whether the target is capable of being captured. This is the kind of spying that the Israelites had in mind when they requested from Moses to send out spies. This kind of mission presupposes a lack of faith in G'd's power or willingness to help the Jewish people attain their objectives. Moses perceived this and that is why the Midrash tells us that Moses reacted negatively to their request at first. The Israelites tricked Moses into agreeing to the spy scheme as it made searching all over the land of Canaan a legitimate endeavour. Joshua too sent the spies for a necessary purpose, one that did not denigrate G'd's part in the preparations to conquer each part of the land of Canaan. The only thing about the scheme of sending out spies which was flawed was the purpose, not the scheme itself.