The Reason for The Miracles(Masechet Berachot Daf נד. Perek 9 Siman 5)
(condensed from Ein Ayah, Berachot 9:5)
Gemara: The Passageway of the Sea is understandable as it says, “Bnei Yisrael came into the midst of the sea in dry land” (Shemot 14:22), as is the Passageway of the Jordan, as it is written, “… and all of Israel passed through it in dry land” (Yehoshua 3:17).
Ein Ayah: The language of this gemara fits in well with the thesis of the Rambam (Yesodei Hatorah 8:1). He said that the main purpose of the miracle of the splitting of the sea was not to prove the reliability of Moshe, for this was to be accomplished clearly at the giving of the Torah at Sinai. There it says, “… and in you [Moshe] they will believe forever” (Shemot 19:9). Rather, the main purpose was to enable Bnei Yisrael to pass the Sea, the Jordan, and the Arnon Valley, respectively. In order to stress this, the Rabbis refer to each one as “the Passageway.”
On the other hand, presumably, even the Rambam would agree that the reason that they were in the position that the miracles became necessary was for the spiritual gain of heightened belief in Hashem and fear of Him. Even if the Rambam did not think that this was the main factor, it certainly was a factor.