You stretched forth Your right hand; the land swallowed them.
The Mechilta says that this possuk teaches us that the sea threw them to the dry land, and the dry land threw them to the sea. Neither wanted the Mitzrim to stay with them. The dry land told the sea, “I accepted the blood of one individual person, Hevel, and I was cursed for that forever. How could I accept the bodies of thousands of people?” The earth refused them until Hashem promised the earth that He would not punish them for this. Our possuk of נָטִיתָ יְמִינְךָ - You stretched forth Your right hand, is an expression of an oath. Hashem took an oath that He would not punish the earth.
The Gemara in Pesachim says that Hashem told the celestial Master of the Sea to spit the bodies of the Mitzrim out to the dry land, but the master of the sea did not want to do so. He said, “Ribono shel Olam, have You ever heard of a Master who gives his slave a gift, and then turns around and takes it back from him?!”
Hashem answered, “I will reimburse you handsomely for this; there is no reason to worry. When Sisera fights against Klal Yisroel and is defeated by Barak and Yael, his soldiers will be drowned in the sea, and there will be one and a half times the number of soldiers there as there were in the Mitzri army.”
The Master of the sea asked, “Ribono shel Olam, have You ever heard of a servant demanding something from his Master? How will I be able to enforce this promise?”
Hashem answered, “The Kishon river will be the guarantor that I will keep my promise!”
The Master of the Sea accepted this, and he spat the Mitzri army onto the dry land near the Jewish camp. This Gemara tells us that both the sea and the dry land wanted to hold on to the Mitzrim, and the Mechilta seems to be saying the opposite. Additionally, why did Hashem need a guarantor? Could He not repay his debts on His own?
The entire Sugya is not fully understood. The sea will never allow a body to be buried under its waves. When a body falls into the sea, it is eventually spat out to the dry land. Why would the bodies of the Mitzrim be different? Eventually, they, too, would have been washed up ashore. The sea generally has no interest in human bodies.
Rashi and the Rashbam explain that the sea wanted the bodies to serve as food for the fish that inhabit the sea. According to this explanation, what prevented the fish from eating the Mitzrim? Why, indeed, were they washed up ashore? We can posit that they had decomposed already and were not edible to the fish. But this would mean that they were not buried in time, which is against the Halacha. Why would Hashem not bury them in time, like all other bodies? They deserved a punishment for their deeds, but once they were dead, what purpose was served with the delay of their burial?
The Ohr Hachaim explains that the Mechilta tells us on the words וַיַרְ א יִּשְרָאֵל אֶת מִּצְרַיִּם מֵת עַל שְפַת הַיָם – and Yisroel saw the Mitzrim die at the shore of the sea, that they were not dead when they were washed up, and Klal Yisroel could see them dying. They were washed up at the end of the death process.
This is the point the Gemara makes. The Master of the Sea told Hashem, “I have a Mitzvah in my hands; I can destroy the evil ones who attacked You and Your nation, I don’t want to give up this opportunity. You gave me this as a gift; how can you take it away from me?” All of Hashem’s creation wishes to honor Him and fight His fights; the sea is no different. The Gemara in Pesachim writes that the Mal’ach Gavriel wished to descend to this world to extinguish the fire in which Avraham Avinu was flung. Hashem said, “I will do it, and I will repay you with the salvation of three of his descendants.” Even a Mal’ach, who has no free will, wishes to serve Hashem. The sea was appeased with the honor of drowning other enemies of Hashem, when Sisra and his army fought with Klal Yisroel and lost.
Another reason the sea wished to annihilate the Mitzrim was based on the idea that the souls of the wicked ones do not arise to Heaven. They stay at the place where they expired, and their abilities, talents, and powers are available at the place of their death. The sea wanted to use the abilities of the Mitzrim to serve Hashem, and for that, he had to be the one to kill them. Hashem gave him this gift of the Mitzrim, and it would be unbecoming for Hashem to demand it back. Hashem then told the sea that He would repay them with Sisra and his army.
After the Mitzrim were dead, the earth had no reason to want them, and neither did the sea. That is when they argued with each other to pass on the dead Mitzrim to each other.