Rejoicing over enemies?
שְׁמוּאֵל הַקָּטָן אוֹמֵר, (משלי כד) בִּנְפֹל אוֹיִבְךָ אַל תִּשְׂמָח וּבִכָּשְׁלוֹ אַל יָגֵל לִבֶּךָ, פֶּן יִרְאֶה ה' וְרַע בְּעֵינָיו וְהֵשִׁיב מֵעָלָיו אַפּוֹ:
Shmuel Hakatan said: “If your enemy falls, do not exult; if he trips, let your heart not rejoice, lest the Lord see it and be displeased, and avert his wrath from him” (Proverbs 24:17).
בִּנְפֹל אוֹיִבְךָ אַל תִּשְׂמָח. פָּסוּק הוּא בְּמִשְׁלֵי, אֶלָּא שֶׁשְּׁמוּאֵל הַקָּטָן הָיָה רָגִיל לְהוֹכִיחַ בְּנֵי אָדָם בְּמִדָּה זוֹ: פֶּן יִרְאֶה ה' וְרַע בְּעֵינָיו. שֶׁעֲשִׂיתוֹ בִּלְבָבְךָ כְּאִלּוּ הוּא שְׁלוּחֲךָ לְמַלְאוֹת תַּאֲוָתְךָ: וְהֵשִׁיב מֵעָלָיו אַפּוֹ. מִדְּלֹא כְּתִיב וְשָׁב אֶלָּא וְהֵשִׁיב, מַשְׁמַע יַסִּירֵהוּ מֵעַל אוֹיְבֶיךָ וִישִׁיבֵהוּ עָלֶיךָ:
"'When your enemy falls, do not be happy'": It is a verse in Proverbs, but Shmuel the Younger was accustomed to rebuking people with this attribute. "'Lest God see and it be bad in His eyes'": that you have made Him in your heart as if He is your agent to fulfill your desire. "'and He turn from him [the enemy] His anger'": Since it did not write, "and He return (veshav) but rather, and He turn (veheshiv), it is implied that He removes it from your enemy and turns it upon you.
(ט) בְּפֶ֗ה חָ֭נֵף יַשְׁחִ֣ת רֵעֵ֑הוּ וּ֝בְדַ֗עַת צַדִּיקִ֥ים יֵחָלֵֽצוּ׃ (י) בְּט֣וּב צַ֭דִּיקִים תַּעֲלֹ֣ץ קִרְיָ֑ה וּבַאֲבֹ֖ד רְשָׁעִ֣ים רִנָּֽה׃

(9) The impious man destroys his neighbor through speech, But through their knowledge the righteous are rescued. (10) When the righteous prosper the city exults; When the wicked perish there are shouts of joy.

(יא) אֱמֹ֨ר אֲלֵיהֶ֜ם חַי־אָ֣נִי ׀ נְאֻ֣ם ׀ אֲדֹנָ֣י יְהוִ֗ה אִם־אֶחְפֹּץ֙ בְּמ֣וֹת הָרָשָׁ֔ע כִּ֣י אִם־בְּשׁ֥וּב רָשָׁ֛ע מִדַּרְכּ֖וֹ וְחָיָ֑ה

(11) Say to them: As I live—declares GOD—it is not My desire that the wicked shall die, but that the wicked turn from [evil] ways and live.

הָנְהוּ בִּרְיוֹנֵי דַּהֲווֹ בְּשִׁבָבוּתֵיהּ דְּרַבִּי מֵאִיר וַהֲווֹ קָא מְצַעֲרוּ לֵיהּ טוּבָא. הֲוָה קָא בָּעֵי רַבִּי מֵאִיר רַחֲמֵי עִלָּוַיְהוּ כִּי הֵיכִי דְּלֵימוּתוּ. אָמְרָה לֵיהּ בְּרוּרְיָא דְּבֵיתְהוּ: מַאי דַּעְתָּךְ — מִשּׁוּם דִּכְתִיב ״יִתַּמּוּ חַטָּאִים״, מִי כְּתִיב ״חוֹטְאִים״? ״חַטָּאִים״ כְּתִיב. וְעוֹד, שְׁפֵיל לְסֵיפֵיהּ דִּקְרָא ״וּרְשָׁעִים עוֹד אֵינָם״, כֵּיוָן דְּ״יִתַּמּוּ חַטָּאִים״ ״וּרְשָׁעִים עוֹד אֵינָם״? אֶלָּא בְּעִי רַחֲמֵי עִלָּוַיְהוּ דְּלַהְדְּרוּ בִּתְשׁוּבָה, ״וּרְשָׁעִים עוֹד אֵינָם״. בְּעָא רַחֲמֵי עִלָּוַיְהוּ, וַהֲדַרוּ בִּתְשׁוּבָה.

There were these hooligans in Rabbi Meir’s neighborhood who caused him a great deal of anguish. Rabbi Meir prayed for God to have mercy on them, that they should die. Rabbi Meir’s wife, Berurya, said to him: What is your thinking? On what basis do you pray for the death of these hooligans? Do you base yourself on the verse, as it is written: “Let sins cease from the land” (Psalms 104:35), which you interpret to mean that the world would be better if the wicked were destroyed? But is it written, let sinners cease?” Let sins cease, is written. One should pray for an end to their transgressions, not for the demise of the transgressors themselves. Moreover, go to the end of the verse, where it says: “And the wicked will be no more.” If, as you suggest, transgressions shall cease refers to the demise of the evildoers, how is it possible that the wicked will be no more, i.e., that they will no longer be evil? Rather, pray for God to have mercy on them, that they should repent, as if they repent, then the wicked will be no more, as they will have repented. Rabbi Meir saw that Berurya was correct and he prayed for God to have mercy on them, and they repented.

ומי חדי הקב"ה במפלתן של רשעים והא כתיב (דברי הימים ב כ, כא) בצאת לפני החלוץ ואומרים הודו לה' כי לעולם חסדו וא"ר יוחנן מפני מה לא נאמר כי טוב בהודאה זו לפי שאין הקב"ה שמח במפלתן של רשעים ואמר רבי יוחנן מאי דכתיב (שמות יד, כ) ולא קרב זה אל זה כל הלילה בקשו מלאכי השרת לומר שירה אמר הקב"ה מעשה ידי טובעין בים ואתם אומרים שירה אמר רבי אלעזר הוא אינו שש אבל אחרים משיש ודיקא נמי דכתיב כן ישיש ולא כתיב ישוש ש"מ
Rabbi Yehoshua ben Levi asked: Does the Holy One, Blessed be He, in fact rejoice over the downfall of the wicked? But it is written: “As they went out before the army, and say: Give thanks to the Lord, for His kindness endures forever” (II Chronicles 20:21), and Rabbi Yoḥanan said: For what reason were the words: “for He is good” not stated in this statement of thanksgiving, as the classic formulation is: “Give thanks to the Lord; for He is good; for His kindness endures forever” (I Chronicles 16:34)? Because the Holy One, Blessed be He, does not rejoice over the downfall of the wicked. Since this song was sung in the aftermath of a military victory, which involved the downfall of the wicked, the name of God was not mentioned for the good. And similarly, Rabbi Yoḥanan said: What is the meaning of that which is written: “And the one came not near the other all the night” (Exodus 14:20)? The ministering angels wanted to sing their song, for the angels would sing songs to each other, as it states: “And they called out to each other and said” (Isaiah 6:3), but the Holy One, Blessed be He, said: The work of My hands, the Egyptians, are drowning at sea, and you wish to say songs? This indicates that God does not rejoice over the downfall of the wicked. Rabbi Elazar said that this is how the matter is to be understood: Indeed, God Himself does not rejoice over the downfall of the wicked, but He causes others to rejoice. The Gemara comments: One can learn from the language of the verse as well, as it is written: “So the Lord will rejoice [ken yasis]” (Deuteronomy 28:63). And it is not written yasus, the grammatical form of the verb meaning: He will rejoice. Rather, it is written yasis. The grammatical form of this verb indicates that one causes another to rejoice. Consequently, these words are understood to mean that God will cause others to rejoice. The Gemara concludes: Indeed, learn from it that this is the case.