Vayeira (Genesis 18-22 )
The people of Sodom where wicked to the core. One of the many expressions of their evil lifestyle was the way they treated "guests" of their city. Basically, they would torture them and make it clear that they were not welcome visitors. As such, they were not exactly thrilled to find out that Lot, the nephew of the world's champion of kindness, had brought guests into his home and was showering the kindness of hospitality upon them.
They unanimously decided that they must put an immediate stop to this heinous breach of their city's long-standing custom. So, they all gathered together and surrounded the house of Lot, demanding "Where are the men that came to you tonight? Bring them out to us and we shall know them (Gen. 19:5)."
Of course, Lot's guests were in fact malachim (angels) who were sent by Hashem to destroy the city of Sodom and save Lot. When the people of Sodom surrounded Lot's house and tried to force their way in, the malachim smote them all with blindness. Despite this blow, however, (and probably because of it) the Torah states "...and they tried to find the opening [to Lot's house] in vain (Gen. 19:11)."
The Sforno (one of the great, medieval commentators on the Torah) comments, "Even though they were smitten by blindness, they toiled to find the opening in order to break the door. This is in accordance with the saying of the Sages that even when the wicked are standing at the opening of Gehinom (Hell) they do not repent." The evil nature of Sodom was so ingrained in their being that nothing would keep them from attempting to achieve their wicked desires.
This point may serve as a clarification for the following difficulty. In last week's parsha, we find a seemingly peculiar discrepancy of conduct on the part of Avraham Avinu: on the one hand he accepts gifts from Pharaoh (which greatly add to his wealth), yet he adamantly refuses to accept any of the bounty of the king of Sodom. Furthermore, in the case of Pharaoh the gifts were given as a result of Pharaoh needing to pacify Avraham and Sarah, whereas in the case of Sodom, Avraham had a right to take the spoils because he was the victor in war.
In addition, neither Egypt and Sodom were exactly the pinnacle of perfection. The Torah explicitly states that the reason Avraham posed his wife Sarah (when they entered Egypt) as his sister is out of fear that "... they will say 'this is his wife' and they will kill me and they will keep you alive (Gen. 12:12)." Clearly, ancient Egyptian society was not exactly a bastion of morality. As such, the question must be asked: what made Sodom so much worse that "Avraham said to the king of Sodom, 'I have lifted my hand (in oath) to Hashem the Supreme Power, the Creator of heaven and earth. If from thread and until shoelace and if I will take from all that is yours and you shall not say 'I made Avram wealthy' (Gen. 14:22-23)"? Another obvious difference between these two societies is their outcome: Sodom was utterly destroyed, whereas Egypt was not. Why?
The most basic approach to answer this question is very simply that the degree of wickedness that Sodom had reached obviously far surpassed any other society. Another component of the equation is that Sodom was located in what was destined to become Eretz Yisrael, which is the Land in which Hashem chose to rest His Divine Presence. As such, any wrongdoing there is considered far more severe. Yet another point to include is that our Sages describe to us (as cited by Rashi 18:21) the horrifically intense degree of evil that Sodom demonstrated in regard to their fellow human beings; and when one sins in a manner that also involves causing damage to other people it compounds the wickedness that much more.
All of these points certainly help us to understand that Sodom's evil was more severe than that of Egypt's.
However, based on the above description of Sodom's reaction to being smitten with blindness and the Sforno's comment thereupon, we can perhaps suggest another, more fundamental difference between Sodom and Egypt.
When Hashem smote Pharaoh and his household in response to abducting Sarah, Pharaoh's response was, "...and now here is your wife - take [her] and go (12:19)." Although not exactly the height of altruism, this response is a clear expression of Pharaoh's recognition that he cannot, under any circumstances, continue along this path of conduct. To a certain degree, he had a positive response to the potch that was sent to him from Heaven.
The people of Sodom, on the other hand, responded in a manner that was in stark contrast; they pressed on in their attempt to achieve their evil plans. They paid not the slightest bit of attention to the Heavenly wrath that they were experiencing; to them, it was as if nothing happened! This is an expression of evil to the core. The whole nature of Sodom was evil; without a trace of goodness left in them. Evil had permeated their being through and through. Therefore, Avraham could not allow himself to benefit from them even one iota, and that is why that society had to be utterly destroyed.
Our Sages teach us that one of the virtues by which one can acquire Torah is by loving rebuke. Throughout life, we often put in our best effort to do things right (whether regarding health, livelihood, family, etc.) only to be faced with difficulties, frustrations, hardships, etc. It is imperative that we realize that all such setbacks and difficulties that we experience in life are sent to us from Above in order to send us a message that we need to try to examine and improve our ways. By approaching life with this outlook we will be doing a great deal to achieve the purpose for which we were created. And, at the same time we will feel a much deeper and more profound sense of purpose in our lives as we recognize that even the annoyances and hardships of life have been sent to us for a specific purpose - that being to awaken us to improve and constantly climb the ladder towards achieving good.
Based on the insight of Reb Avraham Hoschander