Spies are not traitors. And traitors are not spies.
Spies are those who seek information from enemies, usually in a surreptitious manner. The Israelite spies did that: they sought information about the land God had promised to God's people.
Americans have come to be lazy about these terms. It has become traditional for news sources to call an American who has provided information to an enemy a "spy."
Such a person is not a spy: he is a traitor.
A traitor is one who sells out his own country to others.
Spying is a sometimes honorable and necessary task in a fallen world. Calling those who are traitors "spies" demeans the character of men like Caleb and Joshua. These men were spies, and were commended by God.