Our Gemara on Amud Beis discusses the halachos of blemishes on a home. Now this is not your typical home inspection, looking for leaks or structural flaws. Instead the verses (Vayikra 14) discuss finding leprous spots on the walls of a home. These rules only applied to homes acquired after entry into the land of Israel and conquest. 

כִּ֤י תָבֹ֙אוּ֙ אֶל־אֶ֣רֶץ כְּנַ֔עַן אֲשֶׁ֥ר אֲנִ֛י נֹתֵ֥ן לָכֶ֖ם לַאֲחֻזָּ֑ה וְנָתַתִּי֙ נֶ֣גַע צָרַ֔עַת בְּבֵ֖ית אֶ֥רֶץ אֲחֻזַּתְכֶֽם׃

When you enter the land of Canaan that I give you as a possession, and I inflict an eruptive plague upon a house in the land you possess,

וּבָא֙ אֲשֶׁר־ל֣וֹ הַבַּ֔יִת וְהִגִּ֥יד לַכֹּהֵ֖ן לֵאמֹ֑ר כְּנֶ֕גַע נִרְאָ֥ה לִ֖י בַּבָּֽיִת׃

the owner of the house shall come and tell the priest, saying, “Something like a plague has appeared upon my house.” No

וְרָאָ֣ה אֶת־הַנֶּ֗גַע וְהִנֵּ֤ה הַנֶּ֙גַע֙ בְּקִירֹ֣ת הַבַּ֔יִת שְׁקַֽעֲרוּרֹת֙ יְרַקְרַקֹּ֔ת א֖וֹ אֲדַמְדַּמֹּ֑ת וּמַרְאֵיהֶ֥ן שָׁפָ֖ל מִן־הַקִּֽיר׃

If, when he examines the plague, the plague in the walls of the house is found to consist of greenish or reddish streaks that appear to go deep into the wall,

The process continues with increasing intervention. First the afflicted section is cut out of the stone, but if the “mold” returns, the entire house must be demolished and rebuilt.

Rashi, quoting the Midrash, says that in fact this upheaval is for a good thing. The prior occupants from the Seven Nations, fearing conquest, hid valuables and treasures in the walls of their homes. Thus the tragic destruction of a home had a hidden benefit.

The problem with this optimistic formulation is that this does not seem to be such a wonderful way for God to show his affection. Yes, it is great to find buried treasure, but can you imagine what it is like to be displaced from your home? Anyone who lived through Hurricane Sandy or read about Katrina and experienced or witnessed the trauma of thousands of families losing their homes for months can understand this. Indeed the Gemara (Erchin 16a) says that home leprosy comes as a punishment for miserliness, so it’s not such a good thing. 

The Netziv (Ha’amek Davar ibid), based on the Zohar, explains that if the home was established with impure elements such as idolatrous materials, or we might even say with idolatrous rituals, or perhaps ill begotten money or labor, this presence must be expunged. Kedushas Levi (ibid) says this is the real hidden treasure, to remove and purify harmful spiritual elements that could have caused harm. An invisible but toxic radon gas. I think the simple answer though is that the person may be deserving punishment in one way, but deserve, or come through the process to deserve, a great reward as well. So it’s not a contradiction. It’s a punishment for sure with possible redemptive elements.

This is the classic argument that people make when there is a terrible loss, not merely that it is an opportunity to learn of grow, but really it is all for the best and that there is some hidden benefit. Personally I find such thinking simplistic and irritating. Of course there are clear indications from our sages of this exact philosophy, so I am not disputing it. For example, the famous story of Rabbi Akiva (Berachos 60b) whose lantern, rooster and donkey were lost and attacked by wild animals while traveling. As it turned out, because his lantern no longer was lit nor his animals making noise, he was saved from being noticed by a marauding battalion. Similarly, the story of Nachum Ish Gam Zo (Ta’anis 21a) where he always would say, “This too is for the best.” And aside from stories, which you could say is about individuals of unusual merit, the Gemara (Niddah 31a) advises this and seems to apply it to everyone:

דרש רב יוסף מאי דכתיב (ישעיהו יב, א) אודך ה' כי אנפת בי ישוב אפך ותנחמני במה הכתוב מדבר

Rav Yosef taught: What is the meaning of that which is written: “And on that day you shall say: I will give thanks to You, Lord, for You were angry with me; Your anger is turned away, and You comfort me” (Isaiah 12:1)? With regard to what matter is the verse speaking?

בשני בני אדם שיצאו לסחורה ישב לו קוץ לאחד מהן התחיל מחרף ומגדף לימים שמע שטבעה ספינתו של חבירו בים התחיל מודה ומשבח לכך נאמר ישוב אפך ותנחמני

It is referring, for example, to two people who left their homes to go on a business trip. A thorn penetrated the body of one of them, and he was consequently unable to go with his colleague. He started blaspheming and cursing in frustration. After a period of time, he heard that the ship of the other person had sunk in the sea, and realized that the thorn had saved him from death. He then started thanking God and praising Him for his delivery due to the slight pain caused to him by the thorn. This is the meaning of the statement: I will give thanks to You, Lord, for You were angry with me. Therefore, it is stated at the end of the verse: “Your anger is turned away, and You comfort me.”

והיינו דאמר רבי אלעזר מאי דכתיב (תהלים עב, יח) עושה נפלאות (גדולות) לבדו וברוך שם כבודו לעולם אפילו בעל הנס אינו מכיר בנסו

And this statement is identical to that which Rabbi Elazar said: What is the meaning of that which is written: “Blessed be the Lord God, the God of Israel, Who does wondrous things alone; and blessed be His glorious name forever” (Psalms 72:18–19)? What does it mean that God “does wondrous things alone”? It means that even the one for whom the miracle was performed does not recognize the miracle that was performed for him.

And we find a modern version of this story about the fellow who forgot his Tefilin at the boarding gate, who made a ruckus, and was let off the plane. He missed his flight, and it was none other than the fateful flight 175 which was used as a human missile during 9/11. Unfortunately, at least according to snopes, it is an urban myth ( https://www.snopes.com/fact-check/spared-by-piety/

I suppose that’s why I have a bad feeling when people try to explain tragedies with pious happy outcomes. We run the risk of diluting faith by creating expectations that good outcomes will occur. Perhaps the good outcome is closer to what the Kedushas Levi said earlier; there is no greater treasure or benefit than expunging the impurity. We might say, the experience itself of growing from the suffering is the treasure.

Even if all of this is taken literally and consistently true, it is considered hurtful (ona’as devarim) to tell this to a person at the time of their suffering. Pirke Avos (4:18) warns against trying to comfort a person when he “Still has the deceased in front of him.” The Gemara (Bava Metzi‘a 58b ) says this was the sin of Iyov’s friends.

While we are discussing Iyov, Ralbag in his commentary on Iyov (ch. 33) learns the Gemara Niddah with a clever and creative rationalist twist. The Ralbag was an ultra-rationalist, expanding and developing neo-Platonic themes beyond the Rambam’s view on providence. These are complex discussions but the short version is that both the Rambam (Guide III:51) and Ralbag believed that the principal method (if not only, which is a matter of debate,) of God’s Providence is through the intellect. Intellect is a poor translation, as to a Neo-Platonist, the intellect is the part of the soul which “links up” to God who is pure intellect. (In philosophical terms, the Active Intellect, שכל הפועל, which is an interface between God and Man, possibly a Metatron-like Angel, see Ralbag Mishle 1:8, and Ralbag Bamidbar 29:39)  Intellect doesn’t just mean brains, it means the degree of pure rational and non-physical thought and awareness of truth. Thus, the more pure a person’s thoughts and soul is, the more God guides him via a link between God’s supreme awareness and the much weaker human intellect. The highest level of this experience is prophecy, but lower levels of this experience might be hunches, intuitions or even apparently disruptive events such as an injury causing one to miss a boat fated to sink. It’s not clear from the text of the Ralbag what he means precisely, but it is possible he is saying that since there is  subconscious intuition of doom, the person might engage in a self-destructive act to miss the fated event. Regardless, when bad things do happen to us, though we don’t appreciate when others preach to us or presume to know the mind of God, it absolutely is a matter of reflection on any level and we should seek to find meaning in it.