In this analysis, we will assume that there are two distinct purposes of the twelve men's trip. The first purpose is "latur", meaning to explore* the land, to observe its natural characteristics and agricultural bounty, and to report on this to the people. The second purpose is "leragel", meaning to spy, to investigate the military situation and preparations of the land's inhabitants, in preparation for conquest. We can easily distinguish these purposes when they occur. Descriptions of the land and its produce are irrelevant to conquest and thus a part of "exploring"; descriptions of the people and fortifications (which God had promised to overcome) are irrelevant to "exploring" and therefore part of "spying".
The distinction between these purposes is well-known. But I have not seen anyone examine the passages based on these purposes, in the structured manner that I plan to. When I quote verses, I will use bold text to describe exploring, and red italic text to describe spying. This should make clear what exactly is going on in each verse, and allow us to piece together how the entire episode actually took place.
1. In Bamidbar
God's initial command to Moshe mentions only exploring:
Hashem spoke to Moshe saying: "Send you men to explore the land of Canaan which I give to the children of Israel. One man from each tribe you shall send, each one a prince among them."
The men chosen are princes and leaders, perhaps because a public report is most trusted when given by well known and respected individuals.
But when Moshe commands the men before their trip, he greatly expands on God's command:
Moshe sent them to explore the land of Canaan, and said to them:
Go up here in the Negev, and go up the mountain.
And see the land, what it is like,
and the people dwelling in it, are they strong or weak, are they few or many,
and what is the land they dwell in like, is it good or bad,
and what are the cities they dwell in like, are they in camps or fortresses,
and what is the land like, is it fat or thin, does it have trees in it or not?
And you shall be strong, and take from the fruit of the land.
We see that Moshe instructs the men both to explore and to spy. Indeed, he interweaves the two in a kind of chiastic pattern (ABABA).
What do the spies actually do? We see that they perform both parts of their mission:
They went up, and explored the land from the Tzin wilderness to Rehov near Hamat. They went up in the Negev, and came to Hevron, and there were Ahiman, Sheshai and Talmi, children of Anak; and Hevron was built seven years before Tzoan of Egypt. They came to Nahal Eshkol, and cut from there one sprig and cluster of grapes, and carried it on a pole using two men, and [took] from the pomegranates and figs.
The presence of Anakites ("giants") in the land is clearly of military significance. So is the antiquity of Hevron. R' Yaakov Medan explains that ancient Middle East cities were built as "tels", layer upon layer, so the older the city, the higher its "tel" and the harder it would be to conquer.
When the men deliver their report, they also mention both aspects of their mission:
"We came to the land where you send us, and indeed it flows with milk and honey, and this is its fruit. Nevertheless, strong are the people dwelling in the land, and the cities are great and very fortified, and we also saw the children of Anak there. Amalek dwells in the Negev..."
After this the situation descends into a sorry argument and rebellion, but even then the men mention both parts of their mission:
They slandered the land to the children of Israel, saying, "The land which we went in to explore, it is a land which devours its inhabitants, and all the people we saw in it were people of measure. And there we saw the Nefilim, sons of Anak from the Nefilim, and we were like locusts in our eyes, and so were we in their eyes."
And so do Yehoshua and Kalev in their dissent:
The land which we went in to explore, the land is very very good. If Hashem is pleased with us, He will bring us to this land and give it to us. Only do not rebel against Hashem, and do not fear the people of the land, for they are our bread; their defense has left them and Hashem is with us, so do not fear them.
In summary, we see that in God's initial command, only exploring is mentioned. But in every single event that follows, both exploring and spying are mentioned.
I think this is the most straightforward view of the events. God's initial command was simply to explore. For some reason, Moshe combined this with a command to spy. From then on, for the rest of the episode, exploring and spying were linked together.
2. In Devarim
In Moshe's retelling, no Divine command is mentioned. Rather, the initiative for the trip seems to come from the people, and it is purely about spying:
You all approached me, saying: "Let us send men before us, who will search the land for us, and give us a report of the way we shall go up to it and the cities we will come to."
There is no mention of the men being princes. For spying purposes, any twelve soldiers can do, and if anything, top leaders should not be exposed to the risks of a spying mission.
Then, the men went on their journey. What they did involved both exploring and spying, but perhaps the spying seems to be first and most important. Here, for the only time in the Torah, the verb "to spy" is used to refer to this trip:
They turned and went up the mountain, and came to Nahal Eshkol, and spied there. They took in their hands from the fruit of the land, and brought to us...
Surprisingly, the men's report, as initially told, seems to be entirely about exploring:
They said: "Good is the land which Hashem our God has given us."
But then the people begin to complain, and in their complaint they mention a different report, which involves spying. As Moshe tells it:
You complained in your tents, saying: Because Hashem hated us, He took us out of the land of Egypt, to deliver us into the hand of the Amorite to destroy us. Where are we going up to? Our brothers melted our hearts, saying, "The nation is greater and taller than us, and the cities great and fortified up to the heavens, and the sons of the Anakites we saw there."
So what did the twelve men actually report? The results of their exploring, or the results of their spying? I think it's clear that they reported both. But Moshe chooses to dignify their exploring as "the" report, the only one he is willing to mention as such. The report of the spying, he puts in the mouths of the rebellious desert generation, not his own mouth. He thereby implies that the people should have listened only to the exploring.
3. General thoughts
Each passage, in Bamidbar and Devarim, has an internal difficulty. In Bamidbar, the mission includes both exploring and spying, though God had only mentioned exploring. In Devarim, the mission includes both exploring and spying, though the people had only asked to spy. Luckily for us, it seems that each passage supplies the information that is missing from the other. It appears that Bamidbar describes half of what led to the mission (God's command to explore) and Devarim the other half (the people's request to spy). These two initiatives must have occurred around the same time, and Moshe combined them into a single mission, which is fully described in both Bamidbar and Devarim.
For this understanding to work, we must explain what led Bamidbar to exclude the people's request to spy, and Devarim to exclude God's command to explore.
3a. What Bamidbar excludes
Let us start with Bamidbar. In many places, the Torah tells a story twice, and we are supposed to understand something by carefully examining the differences between the original and the retelling. One example is the marriage of Rivka. In the original telling, the slave apparently looked for a hospitable woman from any family. But in his long retelling, he makes it sound like only a relative of Avraham would have been acceptable.
Here in Bamidbar, we have something similar. After God's command, it should be unnecessary to record what Moshe told the men. But Moshe's words are recorded, and they differ from God's command, and this difference (the addition of spying) is exactly what led to the mission's failure. Moshe is the leader, and leaders must take responsibility for their decisions. So here Moshe gets the blame, even if the issue of spying was initially suggested by the people.
3b. What Devarim excludes
Devarim has a different perspective from Bamidbar in two ways. First, Moshe is not speaking as an "objective" historian. Rather, he intends to emphasize the people's past sins and the consequences, to deter them from sinning in the future. Second, he is speaking about himself, so he includes a personal perspective.
As part of Moshe's goal to remind the people of their sins, he shows a negative attitude toward the entire spies episode. If only none of the episode had happened, the death of a whole generation in the desert would have been avoided. The presence of a Divine command to send explorers seriously complicates this picture. Perhaps to keep the message simple, Moshe omits that command entirely.
Interesting, Moshe does use the verb "to explore" ("latur") once. This verb is rare, appearing just 9 times in all of Tanach outside the story in Bamidbar, so its use here is significant. After the negative spying report, Moshe tells the people not to abandon God,
"who travels before you on the road, to explore for you a place to encamp, with fire at night, to show you the road you should walk on, and with cloud by day."For those who had exploring on their mind, Moshe does emphasize that "real" exploring is that which God continually does to protect Israel, and any negative conclusions that might be drawn from 12 men's exploring are insignificant in comparison.
As for how Moshe portrays his own behavior, as one might expect, his perspective is more complex and mixed than that in Bamidbar. Though he puts the blame for initiating the spying on the people, he also admits that "the matter was good in my eyes" (1:23). This makes him complicit in the sin, and explains why "God was angry at me too regarding you, saying: You too shall not go there" (1:37).
Also, Moshe says that he vocally opposed the spies' defeatism when they returned, unlike in Bamidbar where only Yehoshua and Kalev are mentioned as speaking up. Perhaps, Moshe's words are not mentioned in Bamidbar because, naturally, the people would not listen to Moshe when they could listen to men who had actually seen the land. Whereas in Devarim, even an ineffectual criticism from Moshe fits the theme of the criticisms he is giving the people 39 years later.
*Coincidentally, the English "tour" and Hebrew "latur" not only sound the same, but appear to derive from the same root, meaning "to turn", as a person goes back and forth seeing things until he has seen everything. But the word "tour" has the connotations of traveling for pleasure, and without a practical goal in mind, which are out of place here. So I use "explore" as a translation instead.