English: R’ Ami said: Whoever brings himself to impure thoughts is not admitted into the precinct of the Holy One, blessed be He — it is written here “and it was evil in the eyes of Hashem,” and there “For You are not a God who desires wickedness; evil will not dwell with You.”
On the daf / in context: The derash pairs our verse with Tehillim 5:5: one who cultivates evil thought is barred from closeness to Hashem.
Type of Learning
R’ Yishmael #2 — Gezerah shavah on the word רע linking this verse to Tehillim.
What Is Learned
Bringing oneself to impure thoughts is treated with utmost gravity: such a person is not granted entry into Hashem’s “precinct.”