The Or HaChaim examines the opening of the meraglim episode and frames their mission as spiritually fraught from the start. He reads the verses with attention to motive and consequence, helping explain how a seemingly legitimate mission can become a failure of trust in Hashem.
אָכֵן יִתְבָּאֵר הַדָּבָר עַל פִּי דִּבְרֵיהֶם זִכְרוֹנָם לִבְרָכָה שֶׁאָמְרוּ (ילקוט שמעוני תשמ״ב) וְזֶה לְשׁוֹנָם: בִּתְחִלָּה נִתְקַבְּצוּ אֵצֶל מֹשֶׁה לִשְׁלוֹחַ הַמְרַגְּלִים וְלֹא רָצָה, וְאָמַר לָהֶם כְּבָר הִבְטִיחָנוּ ה׳, וְאָמְרוּ לוֹ כִּי הָעֲמָמִים יוֹדְעִים בָּנוּ שֶׁאָנוּ בָּאִים לִירַשׁ אוֹתָם וְהֵם מַטְמִינִים אֶת מָמוֹנָם, וּכְשֶׁיַּגִּיעוּ יִשְׂרָאֵל לֹא יִמְצְאוּ כְּלוּם וְנִמְצָא דִּבְרֵי ה׳ בָּטֵל חָס וְשָׁלוֹם, וְאָז ״וַיִּיטַב הַדָּבָר בְּעֵינֵי מֹשֶׁה״ מַה שֶׁאָמְרוּ (דברים א:כב) ״וְיַחְפְּרוּ לָנוּ אֶת הָאָרֶץ״, פֵּרוּשׁ הַחֲפִירוֹת שֶׁמַּטְמִינִים בָּהֶם מָמוֹנָם וְכוּ׳, כֵּיוָן שֶׁשָּׁמַע מֹשֶׁה כָּךְ נִלְכַּד בְּיָדָם, עַד כָּאן. הִנֵּה מִמַּה שֶׁדִּקְדְּקוּ בְּמַאֲמָרָם זִכְרוֹנָם לִבְרָכָה וְאָמְרוּ ״נִלְכַּד בְּיָדָם״ יוֹרֶה שֶׁבְּמִרְמָה דִּבְּרוּ וּלְכָדוּהוּ בְּעָרְמָה, וְאֵין יָדוּעַ מַה הִיא מִרְמָה שֶׁדִּבְּרוּ בְּפִיהֶם שֶׁבָּהּ נִלְכַּד. אוֹ אֶפְשָׁר, לְצַד שֶׁכַּוָּנַת הַמְּשַׁלְּחִים הָיְתָה רָעָה, תַּפְעִיל פֹּעַל הָרַע בַּשָּׁלִיחַ, וְיַחְזֹר לִהְיוֹת שְׁלוּחוֹ שֶׁל אָדָם כְּמוֹתוֹ, וְיִוָּלֵד בּוֹ תְּכוּנָה רָעָה מַה שֶׁלֹּא הָיְתָה בּוֹ קֹדֶם, כְּדֶרֶךְ שֶׁתִּוָּלֵד בְּחִינַת הַקְּדֻשָּׁה בִּשְׁלוּחֵי מִצְוָה לְטוֹבָה אוֹת, וְלָזֶה הֲגַם שֶׁהָיוּ צַדִּיקִים, בְּהַתְחָלָתָם עֲשׂוֹת הַהֲלִיכָה לְרַגֵּל נוֹלַד בָּהֶם תְּכוּנָה רָעָה מִכֹּחַ הַמְּשַׁלְּחִים וְיָעֲצוּ לְהַדִּיחַ. אָכֵן לְפִי מַה שֶׁפֵּרַשְׁנוּ שֶׁהִתְנָה בַּשְּׁלִיחוּת תְּנַאי הָרִאשׁוֹן ״לְךָ״, פֵּרוּשׁ, לְמַה שֶׁהוּא חוֹשֵׁב שֶׁיִּהְיוּ שְׁלוּחֵי מֹשֶׁה, וּשְׁאָר הַפֵּרוּשִׁים שֶׁפֵּרַשְׁנוּ בָּהּ, וְהוֹסִיף עוֹד תְּנַאי אַחֵר ״אֲנָשִׁים״ שֶׁצָּרִיךְ שֶׁיִּהְיוּ צַדִּיקִים, עוֹד בָּא וְהוֹסִיף תְּנַאי אַחֵר בַּדָּבָר, שֶׁהָרִגּוּל הוּא אֲשֶׁר אֲנִי נֹתֵן לִבְנֵי יִשְׂרָאֵל, פֵּרוּשׁ, לֹא לְשַׁעֵר אִם הָאָרֶץ הַהִיא יֵשׁ כֹּחַ בָּהֶם לְלָכְדָהּ וְלָרֶשֶׁת אֲנָשֶׁיהָ, כִּי זֶה וַדַּאי כִּי אֵין יְכֹלֶת בָּהֶם לַעֲמֹד אֲפִלּוּ כְּנֶגֶד עִיר קְטַנָּה שֶׁבָּהֶם, אֶלָּא אֲשֶׁר אֲנִי נֹתֵן, וְכֵיוָן שֶׁהַדָּבָר הַהוּא בָּא לָהֶם בְּמַתָּנָה, עַל הַנּוֹתֵן לְהוֹצִיא עוֹשְׁקֶיהָ כְּדִין הַנּוֹתֵן מַתָּנָה, וְהוּא יִלָּחֵם לָהֶם וְיַעֲמִידֶנָּה בְּיָדָם בְּאֵין שָׂטָן וְאֵין פֶּגַע רַע. גַּם יַשְׂכִּילוּ בְּרִגּוּלָם אֲשֶׁר יַפְלִיא ה׳ לְהַשְׁפִּיל רָמִים עַם גָּדוֹל וָרָם רַבִּים וַעֲצוּמִים, כְּדֵי שֶׁבַּעַל הַנֵּס יַכִּיר בְּנִסּוֹ. וּבָזֶה נִתְחַכֵּם ה׳ בְּחַסְדּוֹ וְהֵרִים מִלִּפְנֵיהֶם מִכְשׁוֹל כְּשֶׁיִּרְאוּ עֲמָלֵק וְגוֹ׳ וִילִידֵי עֲנָק וְגוֹ׳ וְעֹצֶם חֹזֶק הֶעָרִים הַבְּצוּרוֹת, לְבַל יִפְחֲדוּ וְיִרְאוּ כִּי אֵין יְרֻשָּׁתָם בְּכֹחַ יִשְׂרָאֵל אֶלָּא בְּכֹחַ הַבּוֹרֵא אֲשֶׁר הַכֹּל יוּכַל כִּי הוּא הַנּוֹתֵן.
We may glean a better understanding of the subject when reading the words of the Yalkut Shimoni item 742 that the Israelites came to Moses asking to send spies. Moses said that this was unnecessary seeing G'd had already given His assurance that they would defeat the Canaanites. Thereupon the Israelites countered saying that the local inhabitants were aware of the plans of the Israelites to invade their country and that is why they had hidden all their valuables. As a result the Israelites would be deprived of a great part of what G'd promised them as they would not inherit much more than the mere soil. They convinced Moses that it was in order to make G'd's words come true that they wanted to send out spies. This is why Moses is quoted in Deut. 1,23 as having given his consent to this request. This is also why in Deut. 1,22 the Torah describes the spies' mission as ויחפרו לנו, "that they may dig up for us (hidden treasures)." Moses was trapped by the words of the Israelites. Thus far the Yalkut. Alternatively, the reason they are referred to as wicked was that they carried out a mission initiated by the people who delegated them and whose intent was wicked. When a messenger allows himself to be used by a wicked person for a wicked mission he himself becomes wicked. On the other hand, when a messenger is sent on a sacred errand, then by accepting the errand he himself shares in the sanctity of the person who has delegated him. This enables us to understand why people who, individually, had been known as righteous people at that time became "wicked" when they became tools of the ones on whose behalf they accepted the mission. According to our commentary that the whole scheme of sending out the spies was made Moses' project by the Torah's using the word לך, as well as the other alternatives which we suggested as possible explanations, plus the other condition, that the spies be אנשים, men known as righteous people, the Torah added yet another condition to make this mission an acceptable one. It is that the people doing the spying be aware that it was G'd who was about to give them this land. The words mean that the spies were not to evaluate whether the Israelites (by themselves) would be able to conquer the country and to disinherit its inhabitants. There was no question that they would not be able to do that. They would not be able to conquer even a single town in that land by themselves. The only way the Israelites would be able to do that would be if אני נותן להם, "if I give it to them." Seeing that the land was to be a gift to the Israelites from G'd, it was up to the Donor to ensure the recipients would not face difficulties in obtaining their gift. To this end G'd would have to do the fighting on behalf of the Jewish people. It would be one of the objectives of G'd to show the spies during their tour of the country that G'd would subdue even the most powerful people. In order for the people to appreciate the power of G'd, the people He would subdue had to appear as invincible by natural means. This is why G'd showed the spies the strength of the Amalekites and the giants that still lived in that land. He showed them cities which were fortified beyond one's imagination so as to convince them that G'd certainly did not expect the militarily inexperienced Israelites to wage such a war. He wanted to drive home the point that conquest of that country and its people was G'd's task, not theirs.