Rashi suggests something different. The Hebrew states, “I will give” an affliction to the house suggesting there is a blessing for the house. The Canaanites who lived in the land hid their treasures in the walls of their homes as they prepared for war with the Israelites who intended to take over their land. Adonai, wanting to give the Israelites a gift, taught them the laws of house-afflictions and the need to tear down the walls. When the Israelite owner tore down the walls of his house, he would discover the hidden treasures.