The negativity and spiritual darkness that enveloped the cities of Sodom and Gomorrah was so intense that outsiders refused to step foot within the city boundaries. The wisdom being distilled concerns a self-awareness of the dark side of our own nature. When we associate with negative people, we inevitably fall into their negative sphere of influence, because our own negative side ignites and ultimately dominates us, leading us down a path of darkness. We are to avoid negative people out of concern for our own dark side. This kind of inner reflection and self-awareness is a prerequisite for spiritual development.
Perhaps the greatest deception the angel Satan ever devised was convincing the rational mind that he doesn't really exist. This artful deception extends to the dark side of our own nature. An awareness of our own negative character traits begins to emerge in our consciousness so that we can uproot them and transform our nature. This self-recognition further helps to protect us from external negative influences.