I've been cruising since 1992 and have never had a reason to think the ships had questionable sanitation. The crew is constantly cleaning things, much more so than I've ever seen at a hotel or in a shore-based restaurant. Cruise ships are subject to surprise inspections by various agencies and when a ship gets a low grade the hotel manager for that ship is in serious trouble with the company.
As Raoul correctly notes, the problem is primarily with the passengers. Some board the ship knowing they are sick, but they don't wish to miss their cruise figuring they will get better in a day or two. They then pass it on to the other passengers. Personal hygiene - or should I say the lack thereof - is probably the biggest contributor to illnesses spreading. People use restrooms and don't wash their hands when finished (yuck). They cough and don't try to contain it. I can go on and on.
I personally am a fanatic when it comes to hand washing. I carry hand sanitizer with me on trips. I think if more people simply washed their hands more often the problems would largely go away.
The media has long abandoned what they should be doing - reporting the news - and have moved on to creating news where it doesn't really exist. They trumpet it as an outbreak when 20 people get sick on a cruise ship that has 3000 people aboard. That is probably less of a percentage of illnesses than you'd find in a typical town on any given day.