The way ship HVAC systems are designed, it helps limit costs while simultaneously increasing infections from anything that's airborne.
In regard to Diamond Princess though, there were no safety protocols that were followed, so we don't know if it was the ship or the failure to follow pathogen related protocols.