
Lot's wife violated the command of the angels when they swept them from the city.
אל תבט אחריך LOOK NOT BEHIND THEE — You sinned with them but art saved through the merit of Abraham. It is not fitting that you should witness their doom whilst you yourself are escaping (Genesis Rabbah 50:11).
It's interesting that just 2 verses later Abraham looks at Sodom's destruction and nothing happens to him...
(כו) וַתַּבֵּ֥ט אִשְׁתּ֖וֹ מֵאַחֲרָ֑יו וַתְּהִ֖י נְצִ֥יב מֶֽלַח׃ (כז) וַיַּשְׁכֵּ֥ם אַבְרָהָ֖ם בַּבֹּ֑קֶר אֶ֨ל־הַמָּק֔וֹם אֲשֶׁר־עָ֥מַד שָׁ֖ם אֶת־פְּנֵ֥י יְהֹוָֽה׃ (כח) וַיַּשְׁקֵ֗ף עַל־פְּנֵ֤י סְדֹם֙ וַעֲמֹרָ֔ה וְעַֽל־כׇּל־פְּנֵ֖י אֶ֣רֶץ הַכִּכָּ֑ר וַיַּ֗רְא וְהִנֵּ֤ה עָלָה֙ קִיטֹ֣ר הָאָ֔רֶץ כְּקִיטֹ֖ר הַכִּבְשָֽׁן׃
(26) Lot’s wife looked back, and she thereupon turned into a pillar of salt. (27) Next morning, Abraham hurried to the place where he had stood before יהוה, (28) and, looking down toward Sodom and Gomorrah and all the land of the Plain, he saw the smoke of the land rising like the smoke of a kiln.
ותהי נציב מלח. בְּמֶלַח חָטְאָה וּבְמֶלַח לָקְתָה; אָמַר לָהּ תְּנִי מְעַט מֶלַח לָאוֹרְחִים הַלָּלוּ, אָמְרָה לוֹ אַף הַמִּנְהָג הָרַע הַזֶּה אַתָּה בָא לְהַנְהִיג בַּמָּקוֹם הַזֶּה (בראשית רבה):
ותהי נציב מלח AND SHE BECAME A PILLAR OF SALT — By salt had she sinned and by salt was she punished. He (Lot) said to her once: “Give a little salt to these strangers” and she answered him, “Do you mean to introduce this bad custom, also, into our city?” (Genesis Rabbah 50:4).
His wife looked behind her - Rabbi Isaac said, for she sinned with salt. That night when the angels came to Lot, what was she doing? Going to all her neighbors and saying to them, give me salt, because we have guests. And her intention was that the men of the city would come to know of them. Therefore "she became a pillar of salt."
How does Rashi transform the Midrash?
...ולי נראה על דרך הפשט שהמלאכים הזהירו ללוט, לפי שהיה לו צאן ובקר כי היה רכושו רב, והודיעו שלא ימלט מכל אשר לו דבר, לכן אמרו לו בדרך עצה ונחמה: "המלט על נפשך" כי היא תהיה לך לשלל ואל תביט אחריך לנכסים ולרכוש, כי כולו נאבד, ואל תעמוד בחשבך כי מפה או מפה תציל דבר מכל אשר לך כי אין עוד תקוה בדבר הזה. ויהיה אם כן "אל תביט אחריך" שלא יחוש לבנותיו ולצאנו ולשאר נכסיו אשר נשארו שם; לא שיאסור עליו ההבטה בעיניו, כי למה יאסור לו זה? ויותר טוב היה שבעיניו יביט ובהכרת רשעים יראה (המליצה שאולה מתהלים ל"ז ל"ד)... אשתו של לוט הביטה מאחרי לוט בעלה, כי אחרי שהוא יצא מסדום וציוה לו המלאך "המלט על נפשך, אל תבט אחריך", שלא יחוש לנכסיו ולרכושו, כמו שפרשתי, הנה היא לא עשתה כן אבל הביטה מאחריו, כלומר: התעסקה להציל הצאן והבקר ושאר נכסים, היפך מה שציוה לוט, ולכן בהיותה משתדלת על זה, לא הלכה עם בעלה, והדביקה אותה הרעה, ותהי נציב מלח כשאר העיר.
