Vayikra14:34

כִּי תָבֹאוּ אֶל־אֶרֶץ כְּנַעַן אֲשֶׁר אֲנִי נֹתֵן לָכֶם לַאֲחֻזָּה וְנָתַתִּי נֶגַע צָרַעַת בְּבֵית אֶרֶץ אֲחֻזַּתְכֶם׃

"When you come into the land of Kenaan (Canaan), which I give you as a possession, and I put an affliction of leprosy on a house in the land of your possession,

Vayikra 14:34

כִּי תָבֹאוּ אֶל־אֶרֶץ

Vayikra / Leviticus 14:34 · Sod

Vayikra 14:34

כִּי תָבֹאוּ אֶל־אֶרֶץ כְּנַעַן אֲשֶׁר אֲנִי נֹתֵן לָכֶם לַאֲחֻזָּה וְנָתַתִּי נֶגַע צָרַעַת בְּבֵית אֶרֶץ אֲחֻזַּתְכֶם׃

"When you come into the land of Kenaan (Canaan), which I give you as a possession, and I put an affliction of leprosy on a house in the land of your possession,

Sod סוֹד

Sparks in the walls

Chasidut teaches that in every thing in the world sparks of holiness are hidden, and a person raises them when he serves the Creator. Kedushat Levi reads the treasure in the walls in just this way.

Kedushat Levi: the hidden treasures are sparks (נִיצוֹצוֹת). When a person raises a spark, he takes its inner essence and casts off the outer, and from what is cast off the affliction comes on the house. The peoples of Kenaan were not left alive, and the sparks remained only in the houses. So it is good news: the main joy is the raising of sparks.

How Kedushat Levi explain it

Kedushat Levi And I put an affliction of leprosy in a house of the land of your possession

See in Rashi that it is good news because of the treasures that the Amorites hid. The rule is: the main joy is when a person raises sparks (נִיצוֹצוֹת) to the service of the Creator, blessed is He. And when a person raises sparks, he raises the inner essence within that spark and casts off the outer. And because he casts off the outer, the affliction comes on the house, for the refuse within the spark gives off a stench. And here, when the Eternal, blessed is He, commanded "you shall not leave alive any soul" (Devarim / Deuteronomy 20:16) of the seven nations, the spark remained only inside the houses. This is what Rashi explains: good news because of the hidden treasures, and these are the sparks. And it is good news, which hints at joy. And this is the main joy: the raising of sparks.

Takeaway

The raising of sparks (הַעֲלָאַת נִיצוֹצוֹת) is a teaching of the Kabbalah of the Ari: at creation the light shattered, and its sparks fell into all things of the world. A person raises them by good deeds.
Kedushat Levi builds his explanation on the words of Rashi about the treasure, from the pshat level.