Another interpretation: Why did the Holy One, blessed be He, reveal it to Abraham? Rabbi Judah the Levite said: A parable. To what is the matter comparable? To a king who had an orchard and gave it to his friend as a gift. After some days the king needed to cut beams from within it. The king said: Even though it was mine and I gave it to my friend, I will not cut them down until I take counsel with my friend. So too the Holy One, blessed be He: once He brought him up to the Land of Israel, He said to him, "Please lift up your eyes and look [northward and southward and eastward and westward]" (Genesis 13:14), and it is written, "[For] all the land which you see, [to you will I give it, and to your seed forever]" (Genesis 13:15). Therefore, when the Holy One, blessed be He, wished to destroy these five cities, He said: I will not destroy them except with the knowledge of Abraham. And if you should say that they were not part of the land of Canaan, see what is written: "And the border of the Canaanite was from Sidon [as you come to Gerar, unto Gaza]" (Genesis 10:19). Therefore He did not destroy them until He had taken counsel with Abraham, as it is said, "And the Lord said: Shall I hide from Abraham [what I am doing]?" (Genesis 18:17).
Why God Consulted Abraham Before Destroying Sodom
Midrash Tanchuma Buber, Vayera 7:5
ד"א למה גילה הקב"ה לאברהם, אמר ר' יהודה הלוי משל למה הדבר דומה, למלך שהיה לו פרדס ונתנו לאוהבו במתנה, לאחר ימים נצרך המלך לקוץ מתוכה קורות, אמר המלך אעפ"י שהיה שלי ונתתיו לאוהבי לא אקוץ אותם עד שאמלך באוהבי, כך הקב"ה כיון שהעלהו לארץ ישראל, א"ל שא נא עיניך וראה (ימה וצפונה) [וגו' צפונה ונגבה וקדמה וימה] (שם יג יד), וכתיב [כי] כל הארץ אשר אתה רואה וגו' (שם שם טו). לפיכך כשרצה קב"ה להחריב חמשת כרכים הללו, אמר איני מחריבן אלא מדעתו של אברהם, אם תאמר שלא היו מארץ כנען, ראה מה כתיב ויהי גבול הכנעני מצידון וגו' (שם י יט) לפיכך לא החריבן עד שנמלך באברהם, שנאמר וה' אמר המכסה אני מאברהם.