Leviticus goes into great detail concerning the disease of tzaraat, a spiritual malady that is similar to leprosy in presentation. But the first time this disease is described in the Bible is when Moses first encounters God at the Burning Bush. Moses asks for a sign to prove to the Children of Israel in Egypt that he has been sent by God. In response, God tells him to put his hand in his bosom, and when he takes it out it is covered with tzaraat.
It seems strange that Moses should become stricken with tzaraat, though it disappears as soon as he puts his hand back. A closer look is certainly justified.
Frequently mistranslated as leprosy, tzaraat is a physical affliction caused by a spiritual malady. According to most Jewish sources, the main cause of tzaraat is speaking slander. But Moses did not speak slander. He merely suggested that the Children of Israel would not be open to listening to him (Exodus 4:1). This was a reasonable concern as he appeared as a foreigner. Surely the centuries of slavery had extinguished any hope, or even the ability to hope, from the Jewish people.
But that is precisely the point. Slander, referred to in Hebrew as lashon hara, is a truthful statement made with bad intentions. In the case of Moses, he had essentially accused the Jews in Egypt of not being able to heed the prophet of God. The other sign given to Moses at the Burning Bush was his staff turning into a serpent, hinting at the serpent in the Garden of Eden which caused Eve to sin through sly speech.
Despite the wondrous signs, Moses was still reluctant to go to Egypt so God told him that Aaron, his brother, was already on his way to aid him in his mission. As the progenitor of the priestly line, Aaron had within him the essential cure for tzaraat which was diagnosed by the priest and cured in the Temple. In addition, Aaron did not doubt the Children of Israel for one moment, and he was known for his love of each and every individual.
Part of the process of dealing with tzaraat is being sent out from the Congregation of Israel. By speaking ill of others, a person sets himself apart. As part of the healing process, he has to spend time away from others.
One commentator connects tzaraat to the laws concerning a tree that has consistently dropped its fruit early, before it was ripe. This was a catastrophe for the farmer who had waited years for the fruit. The Talmud teaches that the farmer should paint the trunk white. Passersby will note the white paint and pray for the well-being of the tree. In the same way, when people see the white skin of the person afflicted with tzaraat, they will pray for his spiritual and physical healing, teaching him that he is, indeed, dependent on others though his previous behavior suggests he though otherwise.
The only cure for tzaraat is through the kohen (priest) who represents God and the Temple. The nation of Israel is a community and connects to God as a nation, having received the Torah as a nation. The person afflicted with tzaraat must understand that we are connected to God, not as individuals, but as a nation. We are dependent on each other and speaking lashon hara about another shows a lack of understanding of this fundamental idea. By speaking lashon hara, a person acts as if his perspective is the only one that counts. He has decided that he does not need anyone else. Tzaraat is a graphic reminder that by harming others he harms himself as well. And hopefully time away from the community will teach him how much he relies on others, and perhaps even reawaken his love for his fellow Jew.
While this is true when an individual speaks lashon hara, when the twelve spies returned with a truthful report intended to turn the people against the land of Israel, the normal cure of tzaraat would not suffice. The slander had spread through the entire congregation and had to be entirely erased. A new beginning, a new generation, was needed, with the exception of the two people who were entirely unaffected by the slander against the land of Israel: Joshua and Caleb.