Our Gemara on Amud Beis discusses God’s ambiguous directive to Moshe about sending out the Spies: 

שְׁלַח לָךְ אֲנָשִׁים אָמַר רֵישׁ לָקִישׁ שְׁלַח לְךָ מִדַּעְתֶּךָ וְכִי אָדָם זֶה בּוֹרֵר חֵלֶק רַע לְעַצְמוֹ וְהַיְינוּ דִּכְתִיב וַיִּיטַב בְּעֵינַי הַדָּבָר אָמַר רֵישׁ לָקִישׁ בְּעֵינַי וְלֹא בְּעֵינָיו שֶׁל מָקוֹם

It is stated in the Torah that God told Moses: “Send you men” (Numbers 13:2). Reish Lakish says: “Send you” means that you should send them at your own discretion and not as a divine command. As, if it were a divine command, does a person choose a bad portion for himself? Since God knew the nature of these spies and that they would ultimately slander the land, He certainly would not have sent them Himself. And this is the meaning of that which is written in the passage where Moses retold the story of the spies: “And it was good in my eyes” (Deuteronomy 1:23), and Reish Lakish says: The implication of these words is that it seemed good “in my eyes,” but not in the eyes of the Omnipresent.

This is a theological problem as how could God consent or participate in an ill-fated, sinful activity? Be’er Mayim Chayyim (Bereishis 31:5) explains that it is within the nature of God to provide direction to a person based on where his heart is leaning.  He relates this to the strategic conversation Yaakov had with Rachel and Leah about sneaking out of Laban’s clutches and returning home.  He infers from the verbosity of Yaakov’s words that he wanted Rachel and Leah to understand that God commanded that they return to Canaan not merely to accommodate Yaakov’s desire, but for greater purposes.  Be’er Mayim Chayyim applies this same idea to explain that God directed Moshe to send the Spies because of what was in Moshe’s heart, to see and learn about the Land that God was giving them.  Yes, it did backfire, but at the moment it was merely God providing the righteous with success in whatever they intend and wish for.

This is a powerful idea, that even when experiencing divine guidance, it is not an absolute green light.  It may be God bringing you an opportunity that is good for you, based on your current needs and your current development.  For more on this, see Psychology of the Daf, Yevamos 62, where we discuss a Tosafos that makes this point in a surprising manner regarding Moshe and his choice of celibacy click here: https://nefesh.org/SimchaFeuerman/gods-role-in-supporting-human-free-will-yevamos--psychology-of-the-daf-yomi-.html