Another interpretation of "and the waters were a wall to them" (Exodus 14:22): that Samael came down and said before Him, "Master of the world, did not Israel worship idols in Egypt? And yet You are performing miracles for them!" And he kept sounding his voice to the angelic prince of the sea, who was filled with wrath against them and sought to drown them. Immediately the Holy One, blessed be He, answered him, "Fool of the world! Did they worship it knowingly? They worshiped it only out of the duress of their bondage and out of a deranged mind, and you would judge one who errs unwittingly as one who acts deliberately, and one under compulsion as one acting willingly?" When the prince of the sea heard this, that same wrath with which he had been filled against Israel he turned back upon the Egyptians, as it is said (Exodus 14:28), "And the waters returned" [returned upon the Egyptians] meaning that they turned away from Israel and back upon Egypt.
Samael Accuses Israel of Idolatry at the Sea
Yalkut Shimoni on Torah 234:6
דָּבָר אַחֵר, וְהַמַּיִם לָהֶם חוֹמָה. שֶׁיָּרַד סַמָּאֵל וְאָמַר לְפָנָיו, רִבּוֹנוֹ שֶׁל עוֹלָם, לֹא עָבְדוּ יִשְׂרָאֵל עֲבוֹדָה זָרָה בְּמִצְרַיִם וְאַתָּה עוֹשֶה לָהֶם נִסִּים. וְהָיָה מַשְׁמִיעַ קוֹלוֹ לְשַׂר שֶׁל יָם וְנִתְמַלֵּא עֲלֵיהֶם חֵמָה וּבִקֵּשׁ לְטַבְּעָן. מִיָּד הֵשִׁיב לוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא, שׁוֹטֶה שֶׁבָּעוֹלָם, וְכִי לְדַעְתָּם עֲבָדוּהָ וַהֲלֹא לֹא עֲבָדוּהָ אֶלָּא מִתּוֹךְ שִׁעְבּוּד וּמִתּוֹךְ טֵרוּף דַּעַת וְאַתָּה דָּן שׁוֹגֵג כְּמֵזִיד וְאֹנֶס כְּרָצוֹן. כֵּיוָן שֶׁשָּׁמַע שַׂר שֶׁל יָם, אוֹתָהּ חֵמָה שֶׁנִּתְמַלֵּא עַל יִשְׂרָאֵל הֶחֱזִירָהּ עַל מִצְרַיִם, שֶׁנֶּאֱמַר (להלן פסוק כח) "וַיָּשֻׁבוּ הַמַּיִם", שֶׁשָּׁבוּ מִיִּשְׂרָאֵל עַל מִצְרָיִם.