According to Collins dictionary, a spy is a person employed to obtain secret information or a person who secretly watches others.
The twelve men in Parshat Shlach (Bamidbar 13:2) were not spies. G-d tells Moshe “Send for yourself, men, and have them tour (vayatouru) the Land of Canaan which I am giving to Bnei Yisrael…” Shadal defines “vayatouru” as to tour the land. They were not on a secret mission. They openly toured the entire land and even brought back massive fruits.
In contrast, in the Haftara (Yehoshua 2:1) Yehoshua specifically sent spies: “Yehoshua bin Nun sent out from Shittim two men, spies, secretly, saying, Go observe the Land and Jericho.” The king of Jericho dispatched a search for the men. Rachav, the innkeeper, risked her life to hide them. Rachav gave the men the information that they needed (verse 9): “I know that G-d has given you the Land and that your terror has fallen upon us and that all of the inhabitants of the Land have melted because of you…. When we heard, our hearts melted. No spirit is left in man because of you…” The men returned to Yehoshua and brought back Rachav’s important information which proved that it was the right time to conquer Jericho. The mission of the spies was completed successfully.