"And Moses caused Israel to journey" (Exodus 15:22). Rabbi Simon said: Not everyone who wishes to recite a song recites a song; rather, whoever has a miracle performed for him and recites a song, it is known that he is pardoned for all his iniquities and becomes a new creation. When Israel had a miracle performed for them and recited a song, their iniquities were pardoned, as it is said, "And Moses caused Israel to journey" (Exodus 15:22), that he caused them to journey away from their iniquities. And so you find with Deborah and Barak, for whom a miracle was performed and they recited a song. And how do we know their iniquities were pardoned? Rabbi Aibo in the name of Rabbi Abba: Everywhere it is said, "The children of Israel again did evil," but here it is written, "And the children of Israel did" (Judges 6:1), a beginning of doing. And where is what they had done previously? Rather, the Holy One, blessed be He, pardoned them for what they had done before. And so you find with David, for whom a miracle was performed and he recited a song. And how do we know he was pardoned for all his iniquities? For it is written after his song, "Now these are the last words of David" (2 Samuel 23:1). Where are the first ones? Rather, this teaches that the Holy One, blessed be He, pardoned him.
Song After a Miracle Wipes Away Every Sin
Yalkut Shimoni on Torah 254:1
(שמות טו כב) וַיַּסַּע מֹשֶׁה אֶת יִשְׂרָאֵל, אָמַר רַבִּי סִימוֹן לֹא כָּל שֶׁרוֹצֶה לוֹמַר שִׁירָה אוֹמֵר שִׁירָה, אֶלָּא כָּל מִי שֶׁנַּעֲשָׂה לוֹ נֵס וְאוֹמֵר שִׁירָה בְּיָדוּעַ שֶׁמּוֹחֲלִין לוֹ עַל כָּל עֲוֹנוֹתָיו וְנַעֲשֶׂה בְּרִיָּה חֲדָשָׁה. יִשְׂרָאֵל כְּשֶׁנַּעֲשָׂה לָהֶם נֵס וְאָמְרוּ שִׁירָה נִמְחֲלוּ לָהֶן עֲוֹנוֹתֵיהֶן, שֶׁנֶּאֱמַר וַיַּסַּע מֹשֶׁה אֶת יִשְׂרָאֵל שֶׁהִסִּיעָן מֵעֲוֹנוֹתֵיהֶן. וְכֵן אַתָּה מוֹצֵא בִּדְבוֹרָה וּבָרָק שֶׁנַּעֲשָׂה לָהֶם נֵס וְאָמְרוּ שִׁירָה. וּמִנַּיִן שֶׁנִּמְחֲלוּ עֲוֹנוֹתֵיהֶן, רַבִּי אֵיבוֹ בְּשֵׁם רַבִּי אַבָּא, בְּכָל מָקוֹם נֶאֱמַר "וַיֹּסִיפוּ בְּנֵי יִשְׂרָאֵל לַעֲשׂוֹת הָרַע", וְכָאן כְּתִיב (שם ו, א) "וַיַּעֲשׂוּ בְנֵי יִשְׂרָאֵל", הַתְחָלַת עֲשִׂיָּה, וְהֵיכָן הֵן מַה שֶּׁעָשׂוּ לְשֶׁעָבַר, אֶלָּא מָחַל לָהֶן הַקָּדוֹשׁ בָּרוּךְ הוּא מַה שֶּׁעָשׂוּ לְשֶׁעָבַר. וְכֵן אַתָּה מוֹצֵא בְּדָוִד שֶׁנַּעֲשָׂה לוֹ נֵס וְאָמַר שִׁירָה, וּמִנַּיִן שֶׁנִּמְחַל לוֹ עַל כָּל עֲוֹנוֹתָיו, דִּכְתִיב בָּתַר שִׁירָתוֹ (שמואל ב כג, א) "וְאֵלֶּה דִּבְרֵי דָוִד הָאַחֲרֹנִים", הֵיכָן הֵן הָרִאשׁוֹנִים, אֶלָּא מְלַמֵּד שֶׁמָּחַל לוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא.