"And now, swear to me by the LORD" (Joshua 2:12). It is written, "and you were not as a harlot, in that you scorn payment" (Ezekiel 16:31). Rabbi Shimon said: You find that everything written of Israel for blame is written of Rahab for praise. Of Rahab it is written, "Swear to me by the LORD," but of Israel it is written, "yet they swear falsely" (Jeremiah 5:2). Of Rahab it is written, "and you shall save alive my father and my mother" (Joshua 2:13), but of Israel it is written, "in you they have made light of father and mother" (Ezekiel 22:7). Of Rahab it is written, "and she brought them up to the roof" (Joshua 2:6), but of Israel it is written, "and those who bow down upon the housetops" (Zephaniah 1:5). Of Rahab it is written, "and she hid them with the stalks of flax" (Joshua 2:6), but of Israel it is written, "who say to a tree, You are my father" (Jeremiah 2:27). Of Rahab it is written, "Get to the mountain" (Joshua 2:16), but of Israel it is written, "they sacrifice upon the tops of the mountains" (Hosea 4:13). Of Rahab it is written, "and you shall give me a true token" (Joshua 2:12), but of Israel it is written, "and they speak no truth" (Jeremiah 9:4). Thus, everything written of Israel for blame is written of Rahab for praise.
Where Scripture Blames Israel It Praises Rahab
Yalkut Shimoni on Nach 11:1
ועתה השבעו לי באלהים (יהושע ב, יב). כתיב ולא היית כזונה לקלס וגו' אמר רבי שמעון את מוצא כל מה שכתב בישראל לגנאי כתב ברחב לשבח. ברחב כתיב השבעו לי באלהים ובישראל כתיב אכן לשקר נשבעו. ברחב כתיב והחייתם את אבי ואת אמי ובישראל כתיב אב אם הקלו בך. ברחב כתיב והיא העלתם הגגה ובישראל כתיב ואת המשתחוים על הגגות, ברחב כתיב ותטמנם בפשתי העץ ובישראל כתיב אומרים לעץ אבי אתה. ברחב כתיב ההרה לכו ובישראל כתיב על ראשי ההרים יזבחו. ברחב כתיב ונתתם לי אות אמת ובישראל כתיב ואמת לא ידברו, הוי כל מה שכתב בישראל לגנאי כתב ברחב לשבח: