There was an additional reason for tzara’at breaking out on someone’s house, aside from the reasons given above. When the pagan Canaanites heard that the Jewish people were planning on driving them out of the Land of Israel, they hid their precious wealth in the walls of their homes, hoping that they would eventually return to them. By causing tzara’at to break out on a Jew’s home, G‑d forced the Jew to demolish his wall and reveal this hidden treasure.
Even Righteous People Can Repent
וְנָתַתִּי נֶגַע צָרַעַת בְּבֵית וגו': (ויקרא יד:לד)
I will place a tzara’at-lesion on a house. Leviticus 14:34

Sincere repentance elevates us to degrees of Divine consciousness that we could not have attained otherwise. Since tzara’at struck specifically people who seemingly had nothing to repent for, it enabled even these people to achieve the closeness to G‑d normally reserved for people who have repented for some misdeed.

Although this held true of tzara’at in general, it was most clearly seen in the tzara’at of homes, where the sufferer was rewarded openly by suddenly acquiring the worldly wealth hidden in his walls. This physical windfall reflected the spiritual windfall that the person acquired: his newfound closeness to G‑d.

This is how we should view any apparent misfortune or seeming setback in life. It is G‑d’s way of elevating us to a level of relationship with Him that we could not have reached on our own.1