Some see a hint here to the idea in Chazal that a tzadik can receive the portion in olam ha’ba of a rasha, and vice versa, the rasha can receive the bad lot that might have been in store for the tzadik. The pasuk is not just telling us that Yehoshua and Kalev went unpunished, but more than that – they received the reward that was in store for the other meraglim had they not gone astray.
How does this work -- how can I get someone else’s portion of olam ha’ba? R’ Ahron Kotler (Mishnas R’ Ahron) explains that it’s always easier to do mitzvos and learn Torah when you see your neighbor doing the same, and vica versa. The tzadik who overcomes the negative influence of his neighbor acting wrongly deserves double reward – the reward for the good itself, as well as the reward for not being pulled down by the influence of his neighbor. The rasha deserves a double punishment – punishment for the wrong itself, and punishment for the influence it has on others. (Let’s remind ourselves of his hesber in a few week’s when we get to Chazal’s derasha on “nachamu nachamu” that there was a double nechama for the double sin that caused galus and we ask ourselves what this idea of a double sin means.)
The Ohr haChaim writes that surely there were tzadikim other than Yehoshua and Kalev in Bnei Yisrael. Yet, we don’t find that these other tzadikim were spared punishment – they too, like the rest of the dor hamidbar, died before reaching Eretz Yisrael. The extra pasuk comes to tell us that it was only the fact that Yehoshua and Kalev were “min ha’anashim ha’heim” and could have been part of the cabal, but instead took an independent stand l’shem shamayim, going against the grain, that saved them.
In other words, when there is a moment of crisis, you can be the biggest tzadik, but that’s not going to save you from punishment if all you do is sit on the sidelines and watch. Sometimes there is an obligation to protest, and I would add, even if, as in the case of Kalev and Yehoshua, there are greater people (like Moshe and Aharon) in charge, and even if it comes to naught.