It's not like the ship could keep a shoreline in sight until it reaches the next possible port.
The cruise ships have to face a lot of problems, some being shore side hospitalization of seriously ill people, getting many multinational passengers off the ship and onto airplane flights to places around the world. We are talking about thousands of people, from differfent countries on many cruise ships.
Many of the countries these ships are flagged in do not have the resources of hospitalization and transportation .
Also many countries have shut down their ports to ships coming in.
It is quite a messy problem, since some of the passengers are citizens of the country where the ship wants to dock. And some are facing death, unless they get to a good hospital.
Lots of situations to deal with for the health officials and politicians. -Tom