All twelve spies were revered members of the nation of Israel. Moses picked twelve "distinguished men", leaders of their respective tribes. How could the spies have sinned so completely? How could they have fallen victim to their evil inclination so instantaneously? If the stimulus for the sin were external, then surely Joshua and Caleb would also have sinned. Therefore the sin must have been internal, a fundamental flaw in the mindset of these ten leaders that was subtle enough to not be detected by Moses and the people, yet substantial enough to turn them against God.
The difference between Caleb/Joshua and the ten spies is the difference between "rights" and "obligation". The US Constitution stipulates that all men are entitled to "certain unalienable rights". The first ten amendments, the "Bill of Rights" details that all Americans have the right to property, the right to bear arms, etc. The United States of America has been built upon the values that people deserve certain things, that simply being born makes one entitled. The Torah has no "Bill of Rights", not just because the Torah will never need amendments, but because the Torah entitles no one; there are no "rights"; there are obligations. Rather than awarding everyone a right to property, the Torah obligates everyone to not steal. Rather than awarding everyone the right to bear arms, the Torah obligates everyone to not murder. And the difference is perspective.
How do should one look at the world? Does one say, "Oh I'm here, and therefore I deserve respect, honor, and to be treated compassionately," or does one say, "I am obligated to treat everyone with respect, honor, and kindness". The result is the same if the rules are followed but the mindset for the action is completely different. The difference can be simplified further into two concepts :giving vs. taking. Is the world a free candy store where one can take whatever he desires or is the world an opportunity to take God's gifts to transmit them to others in an attempt to enrich lives. In the end of both roads, people are satisfied and justice exists, but true happiness exists only at the end of one road because true happiness comes from giving.
The ten spies were not bad men, but they let their leadership position affect their judgment. They felt that because of their accomplishments, the world owed them certain niceties, that God owed them certain niceties. The spies wanted to go to Eretz Yisrael very much, but they felt they deserved the Holy Land, therefore taking God out of the equation. As a result, when the spies saw that they would not be able to receive Israel by through their own merit, they could not imagine success. On the other hand, Caleb and Joshua recognized that as spies they were merely messengers of Moses, a messenger of God. Therefore, Caleb and Joshua saw Israel not as something they deserved, but as a gift from God that could be used to transmit goodness and Torah to the world. Reality of the difficulty of conquering Israel encouraged Caleb and Joshua; the harder it was to conquer Israel, the more the land would be a greater gift. The children of Israel, however, were not on this spiritual level. They were influenced by the perspective that they had received miracles, direct contact from God, Exodus from the hands of Egypt, and reception of the Torah. Like the ten spies the Jews began to think that receiving apparent miracles led to deserving Israel. Subsequently, when the Jews heard of the difficulty of conquering the land, they became discouraged. They should have recognized that Israel is not the for the Jews to take, but for God to give.
With this in mind, God's punishment is far more understandable. If the people wanted to take what they deserved, then they would receive nothing: desert, isolation, and exile. But the exile was not permanent. Forty years was long enough for the children of Israel to recognize truly that everything is a gift from God. It is one's job in this world to use those gifts to give, not to take.