Another interpretation of (Psalm 5:5): "Evil shall not abide with You." Rabbi Eleazar ben Pedat said in the name of Rabbi Yochanan: The Name of the Holy One is not mentioned in connection with evil, but only in connection with good. You may know that this is so, for at the hour when the Holy One created the light and the darkness and gave them names, He mentioned His Name in connection with the light, but He did not mention His Name in connection with the darkness, as it is said (Genesis 1:5): "And God called the light Day, and the darkness He called Night." And so too you find, when He created Adam and Eve, He mentioned His Name in connection with them, as it is said (Genesis 1:28): "And God blessed them..."; but when He cursed them, He did not mention His Name in connection with them, as it is said (Genesis 3:16): "Unto the woman He said..."; and (Genesis 3:17): "And unto Adam He said..." And if you should say: In connection with the serpent He did mention it at the hour of its cursing, [as it is written (Genesis 3:14): "And the LORD God said unto the serpent: Because you have done this, cursed are you..."]; thus have the Sages taught: Concerning three things the Holy One mentioned His Name, even though they were for evil,
Why God's Name Rests on the Light but Not the Darkness
Midrash Tanchuma Buber, Tazria 12:1
ד"א לא יגורך רע. אמר ר' אלעזר בן פדת בשם ר' יוחנן אין שמו של הקב"ה נזכר על הרעה אלא על הטובה, תדע לך שהוא כן, שבשעה שברא הקב"ה את האור ואת החושך וקרא להן שמות, הזכיר שמו על האור, ולא הזכיר שמו על החושך, שנאמר ויקרא אלהים לאור יום ולחשך קרא לילה (בראשית א ה), וכן אתה מוצא כשברא אדם וחוה, הזכיר שמו עליהן, שנאמר ויברך אותם אלהים וגו' (שם שם כח), וכשקללם לא הזכיר שמו עליהם, שנאמר אל האשה אמר (שם ג טז), ולאדם אמר (שם שם יז), ואם תאמר על הנחש הזכיר בשעת קללתו, [דכתיב ויאמר ה' אלהים אל הנחש כי עשית זאת ארור את (שם שם יד) ], כך שנו חכמים, על ג' דברים הזכיר הקב"ה שמו, אעפ"י שהן לרעה,