It may be partially that, but it's also that you are trapped in an environment. If you go to a restaurant, you might get lucky where the sick haven't touched your food or you haven't wandered around and touched a surface that they touched. When you are locked on a ship, your odds are greater in coming into contact just from repetition of the same environment, and then others who weren't as lucky when being served or touching things become ill and then you reach critical mass, where nearly everyone becomes ill.
I believe that there was an article recently that stated that the viruses remain active on surfaces longer than once imagined. Plus only very strong cleaners, like bleach, are able to eradicate them on surfaces. And forget about hand sanitizers, not very useful at all.