To understand why distancing oneself from a nisayon is so critical, we must appreciate the power of one’s environment.
At one time New York City was known as a dark and dangerous place. Large sections of the city were known to be unsafe. The subways were grimy with graffiti and filth, muggings and felonies were common, and crime was increasing at an alarming rate.
Then the city elected a new mayor, Rudolph Giuliani, and he, together with his Chief of Police, William Bratton, restored the city to normalcy. Crimes rates dropped drastically and the city’s image gradually improved.
How did they accomplish this? By implementing a policy based on the Broken Windows theory. This theory asserts that crime does not normally occur in a vacuum. It requires a certain environment to fester. A clean, tree-lined suburb is an unlikely place to become a home for criminal activity. Felonies are generated by an atmosphere of “Broken Windows” - filth, neglect, and petty misdemeanors. This type of environment leads to more serious crimes. In a word: A disorderly city is a dangerous city. As Mr. Giuliani told the press in 1998, “Obviously murder and graffiti are two vastly different crimes. But they are part of the same continuum, and a climate that tolerates one is more likely to tolerate the other.”
So Mr. Giuliani cleaned up the city. He painted over the graffiti, kept the city streets clean, prosecuted misdemeanors such as loitering and turnstile jumping ...and sure enough, the major felonies decreased in turn. By taking a hard line on quality-of-life violations, he prevented the occurrence of more serious crime.
This idea - that actions are the direct product of the environment - is really expressed in a well-known Midrash, cited by Rashi.
After Klal Yisrael had worshiped the Eigel HaZahav, Moshe Rabbeinu tried to minimize their transgression by saying to Hashem, “You brought it about. You showered them with gold and anything else they wanted. If a king fills his son with food and drink, dresses him with the finest clothing, hangs perfume around his neck, and then sits him at the doorstep of a house of ill repute - מה יעשה הבן שלא יחאט - what can the son do to avoid sinning?”
Essentially, Moshe was saying that although Klal Yisrael committed a heinous crime, there were mitigating circumstances that should be taken into account. They had suddenly been showered with enormous wealth and unearned opulence. This bounty innately predisposes one to sin and generates decadence. Had Klal Yisrael themselves created that environment, they of course would be wholly responsible, but they did not. Since Hashem had showered them with this wealth, they cannot be fully blamed.
All this relates directly to our discussion as well.
Of course, a breach in kedushas einayim can occur at any time, just as crime can occur in the most pristine environment. But like crime, a breach in kedushas einayim is usually generated by a certain atmosphere. There is a toxic environment that invites a breach in shmiras einayim.
If we create, or even allow, this environment to exist in our own lives, the transgression will almost surely ensue - and we will have no one to blame but ourselves for failing to regulate our environment.