Hashem makes paths in the sea in order to subdue our sins and bring out our righteous deeds.
Sefer HaMidos, Repentance, Part II §8