My guess is that it was about getting you use to moving in cold water in case you ever fall of a ship?
While valuable in building personal fortitude and an ability to swim do not put it beyond simple hazing and being hard for the sake of being hard. Many military schools have similar rituals or experiences, the Japanese in particular took institutionalized cruelty to an almost art form.
Though even Annapolis it would be common to have morning swims or long distance rows or sails on Severn/ Chesapeake.