According to the Sages, leprosy that appeared on the walls of the house that was of the type that mandated the dwelling’s destruction would occasionally benefit the homeowner.
“When you come to the land of Canaan…I shall place a mark of leprosy on a house in the land of your ancestral portion” (Leviticus 14:34). Rabbi Hiyya taught: Are these good tidings, that leprosy is going to afflict them? Rabbi Shimon ben Yohai taught: When the Canaanites heard that the Israelites were coming to do battle against them, they arose and concealed their property in the houses and the fields. The Holy One, blessed be He, said: I promised the Israelites’ ancestors that I will bring their descendants into a land full of everything good, as it is stated: “And houses full of everything good” (Deuteronomy 6:10). What does the Holy One, blessed be He, do to fulfill that promise? He instigates leprosy in an Israelite’s house [that was previously resided in by a Canaanite], and when the Israelite demolishes it, he finds a treasure. His field is blighted, and in the course of plowing, he finds a treasure. (VayikraRabba 17)