Artscroll brings in an explanation from Olelos Efrayim (§547)
The "ship" is the person in his passage through this world (as above,
73a note 21 (Ch. 51). Rabbah states that during his sojourn in this
world he took note of the effect the death of tzaddikim had on people.
Ecclesiastes compares the death of a person to a fish being caught, as
it is written (Ecclesiastes 9:12): For a man does not even know his
hour; like fish caught in a bad net. Thus, the death of the fish in
our story represents the death of a person.
God is very particular with righteous people; they sometimes die on
account of a very small misdeed. A sin contaminates a person and is
therefore compared to a creeping thing which is a source of
contamination (see Leviticus 11:43). Thus, Rabbah said that a small
creeping thing settled in the nostrils of the tzaddik and took away
from him the breath of life.
How do people react to the death of a righteous person? There are
three classes of people. The first class reacts with extreme
abstinence. They see that even the righteous die on account of a minor
sin and they therefore decide to live a life of self-denial and
abstain from all worldly activities. Their lives are thereby
devastated. That is not the way God intended the world. They are the
cities that are destroyed by the dead fish.
The second class reacts just the opposite way. Seeing that even the
righteous perish they perceive death as the ultimate end of all
activity and disregard the after-life. They therefore say to
themselves: For the time being let us eat and drink and make merry,
for tomorrow we will die (see Isaiah 22:13). Death teaches them to
indulge in worldly pleasures. They are the cities that eat from the
dead fish.
The third class adopts a sensible attitude. Death teaches them that
one has to collect as many merits as possible while still alive so
that their reward should be preserved for the next world. They are the
cities that salt the dead fish to preserve it for later.
The barrels of oil are an allusion to the reward of the World to Come,
as the Gemara (Taanis 25a) relates that R' Elazar ben Pedas dreamt of
rivers of balsam oil which represented his reward in the World to
Come. In our story, the oil came from the pupil of one eye, meaning
that the reward is a result of God's surveillance, as it is written
(Psalms 33:18): Behold God's eye is on those who fear Him.
[A year later, Rabbah saw them rebuilding the destroyed cities. The
effects of even the most traumatic experiences wear off with time.
According to the Gemara (Berachos 58b) a person forgets a deceased one
after twelve months. Thus, in our story, even those who were most
moved by the death of the fish, to the extent that their lives were
shattered, could be seen a year later rebuilding their lives, totally
oblivious to the former events.]
This story teaches that upon the death of a righteous person, one
should be stirred to performance of mitzvos with extra zeal.
Furthermore, one should be aware of the fact that the inspiration
derived from any event wears off with time.