כי תבואו אל ארץ כנען אשר אני נותן לכם לאחוזה וננתי נגע צרעת בבית ארץ אחוזתכם
Rashi teaches us that Moshe Rabbeinu brought good tidings when he informed the people that they would be subject to nigei battim, plagues that would strike their homes. Apparently, when the Emorites heard that the Jews were coming to attack them, they hid their gold, silver and jewelry in the walls of their homes. As a result of the negaim, the homes had to be dismantled, exposing the hidden treasures. To recap, the individual who acted inappropriately was punished with the destruction of his home. As a result of the punishment, he became the lucky winner of a hidden treasure…
