Rabbi Elazar says: Anyone who grasps himself improperly is as if he brings a flood upon the world, as it is said, "For all flesh had corrupted" (Genesis 6:12). Rabbi Yochanan said: Anyone who emits seed in vain is liable to death, as it is said, "And what he did was evil in the eyes of the LORD, and He put him also to death" (Genesis 38:10). Rabbi Yitzhak of the school of Rabbi said: It is as if he sheds blood, as it is said, "You who inflame yourselves among the terebinths, under every leafy tree, who slay the children" (Isaiah 57:5) - do not read "slay" but "squeeze out." Rav Ashi said: It is as if he worships idols. It is written here, "under every leafy tree," and it is written elsewhere, "upon the high mountains and under every leafy tree" (Deuteronomy 12:2). Rav Assi said: Anyone who brings himself to lustful imagining is not admitted within the partition of the Holy One, blessed be He. It is written here, "and what he did was evil in the eyes of the LORD" (Genesis 38:10), and it is written, "Evil shall not dwell with You" (Psalms 5:5). What is the meaning of what is written, "Your hands are full of blood" (Isaiah 1:15)? These are the ones who commit adultery with the hand. As the school of Rabbi Ishmael taught: "You shall not commit adultery" (Exodus 20:13) - there shall be no adulterer in you, whether by hand or by foot. Rabbi Ammi said: One who deliberately arouses himself is called an idolater, for such is the craft of the evil inclination: today it says to him, "Do this," and tomorrow it says to him, "Go worship idols."
Wasted Seed as Bloodshed and the Craft of the Evil Inclination
Yalkut Shimoni on Torah 51:1
רַבִּי אֶלְעָזָר אוֹמֵר, כָּל הָאוֹחֵז בָּאַמָּה וּמַשְׁתִּין כְּאִלּוּ מֵבִיא מַבּוּל לָעוֹלָם שֶׁנֶּאֱמַר כִּי הִשְׁחִית כָּל בָּשָׂר, אָמַר רַבִּי יוֹחָנָן, כָּל הַמּוֹצִיא שִׁכְבַת זֶרַע לְבַטָּלָה חַיָּב מִיתָה, שֶׁנֶּאֱמַר "וַיֵּרַע בְּעֵינֵי ה' אֲשֶׁר עָשָׂה וַיָּמֶת גַּם אֹתוֹ". רַבִּי יִצְחָק דְּבֵי רַבִּי אָמַר, כְּאִלּוּ שׁוֹפֵךְ דָּמִים, שֶׁנֶּאֱמַר (ישעיהו נז, ה) "הַנֵּחָמִים בָּאֵלִים תַּחַת כָּל עֵץ רַעֲנָן שֹׁחֲטֵי הַיְלָדִים", אַל תִּקְרִי 'שֹׁחֲטֵי' אֶלָּא 'סוֹחֲטֵי'. רַב אַשִּׁי אָמַר כְּאִלּוּ עוֹבֵד עֲבוֹדָה זָרָה, כְּתִיב הָכָא (שם) "תַּחַת כָּל עֵץ רַעֲנָן" וּכְתִיב הָתָם "עַל הֶהָרִים הָרָמִים וְתַחַת כָּל עֵץ רַעֲנָן". אָמַר רַב אַסִּי, כָּל הַמֵּבִיא עַצְמוֹ לִידֵי הִרְהוּר אֵין מַכְנִיסִין אוֹתוֹ בִּמְחִיצָתוֹ שֶׁל הַקָּדוֹשׁ בָּרוּךְ הוּא, כְּתִיב הָכָא, (בראשית לח, י) "וַיֵּרָע בְּעֵינֵי ה'" וּכְתִיב (תהלים ה, ה) "לֹא יְגֻרְךָ רָע" מַאי דִּכְתִיב (ישעיהו א, טו) "יְדֵיכֶם דָּמִים מָלֵאוּ" אֵלּוּ הַמְּנָאֲפִים בַּיָּד כִּדְתָּנָא דְּבֵי רַבִּי יִשְׁמָעֵאל "לֹא תִנְאָף" לֹא יִהְיֶה בְּךָ נֹאֵף בֵּין בַּיָּד בֵּין בָּרֶגֶל. רַבִּי אַמִּי אָמַר, הַמַּקְשֶׁה עַצְמוֹ לָדַעַת נִקְרָא עוֹבֵד אֶלִילִים, שֶׁכָּךְ אֻמָּנוּתוֹ שֶׁל יֵצֶר הָרָע הַיּוֹם אוֹמֵר לוֹ עֲשֵׂה כָּךְ לְמָחָר אוֹמֵר לוֹ לֵךְ עֲבוֹד עֲבוֹדָה זָרָה.