Devarim, 1:1: “These are the words that Moshe spoke to all Yisrael, on the other side of the Yarden, concerning the Arabah, opposite the Sea of Reeds, between Paranand Tophel and Lavan, and Chatseirosand Dizahav.
Rashi, Devarim, 1:1, Dh: Bein Paran: “…and on what they did in the desert of Paran through the spies.”
Rashi, Devarim, 1:1, Dh: V’Chatseiros: “…dvar acher, he said to them, ‘you should have learnt from what I did to Miriam in Chatseiros because of lashon hara and you spoke against the Makom [HaShem].
Rashi, Bamidbar, 13:1 Dh: Shelach: “Why is the section of the Meraglim connected to the section of Miriam [with regard to her lashon hara]? Because she was punished because of her speech about her brother, and these wicked people saw and did not take mussar.”
In his opening words in Sefer Devarim, Moshe Rabbeinu alludes to a number of sins that the Jewish people committed during their time in the desert. He mentions a number of places that hint at the sin. Paran alludes to the sin of the Meraglim because the spies were sent from there. Chatseiros alludes to another aspect of the sin of the spies in that they did not learn from the punishment that Miriam received for speaking lashon hara, and instead, spoke lashon hara themselves.
The Maharalasks why there are two places that seemingly refer to the same sin of the Meraglim – Paran and Chatseiros? He answers that there were in fact two separate sins that were committed by the Meraglim. One was the actual lashon hara that they spoke, and the other was the sin of not learning from the recent experience of Miriam’s punishment for lashon hara and applying it to their own situation. We see from here that not learning from another persons’ experiences is a sin in and of itself.
Rashi speaks this point out in the beginning of Parshas Shelach, quoting the Midrash Tanchumah. The Midrash states that the Meraglim were doubly guilty for their sin because they saw first-hand the results of speaking lashon hara but did not learn from this and apply it to their own situation with regard to speaking badly about Eretz Yisrael. However, a question arises: It is clear that the spies were very learned men – they surely knew the intricacies of the issur to speak lashon hara – accordingly, even without the experience of Miriam, they certainly would not speak blatant lashon hara for no good reason. Rather, as the commentaries discuss, they had seemingly good reasons as to why they were justified in their speech, and surely believed that their speech constituted lashon hara l’toeles. Consequently, why would the fact that they saw what happened to Miriam, prevent them from lashon hara when they could still rationalize that they had valid reasons for why their speech was permitted and even necessary?
The answer seems to be that the experience of Miriam’s punishment itself should have demonstrated to them that even when a person believes he is speaking l’toeles, there is a very good chance that he is incorrect in his calculations or has biases that are clouding his judgment. As the Rambam writes, Miriam acted with totally pure motives, had no resentments to her brother, and Moshe was not hurt by her speech, and still, she was severely punished. The spies should have learned from Miriam that even if a person feels that he is justified in his speech, he should do intense self-analysis to see if that is really the case, because if it is not, then he will transgress the terrible sin of lashon hara.
One may still ask another question: Even with this lesson that a person must be very careful when speaking lashon hara l’toeles, the two cases seem incomparable. Miriam spoke against Moshe Rabbeinu, whereas the spies spoke against the Land – maybe they reasoned that there was no issur lashon hara about the land, and so the example of Miriam did not apply to them?
Rashi on this week’s Parsha appears to answer this question: He writes, quoting the Sifri, that they spoke against HaShem – that the Meraglim’s speech was not just against the Land of Israel, rather it was against HaShem because by criticizing the Land that He so highly valued, and designated for the Jewish people, they were in effect, criticizing Him. Based on this, it is very apparent why they should have learned from Miriam’s punishment – if she was punished so severely for speaking against a human being, all the more so, they should be careful not to speak against HaShem.
In addition to the obvious lesson about how careful one should be when speaking negatively about someone, even if he feels it is l’toeles, a more general lesson can be derived from these ideas. When we discuss mussar we normally refer to reading a mussar sefer such as Mesillas Yesharim or we think about how the great Baalei mussar would repeat Torah concepts again and again in order to internalize them. Of course, these aspects of mussar are essential, but we learn from Chazal that a basic aspect of mussar is learning from the mistakes of other people. Nowadays, we don’t experience such direct consequences as in the Desert, but still, it is often quite evident how people’s mistakes can have negative results. This can be in the realm of marriage, parenting, or general observance. For example, if a person sees his friend falling in his observance because of an over-reliance on technology, he should take that to heart, apply it to his own use of technology and contemplate whether any changes are needed.
 Gur Aryeh, Devarim, 1:1.
 Such as that they knew Moshe Rabbeinu would die when they entered the Land, and so they wanted to delay his death; or that they did not want to relinquish the supernatural lifestyle that they lived in the desert.
 Rambam, Hilchos Tumas Tzoraas, Chapter 16, Halacha 10
 This answer is based on the Mizrachi al haTorah and Zichron Binyamin Zev on this verse.