If everything works fine, nobody will ever get sick on a space-ship. Most people will come aboard by transporter, which checks for (known) hazardous organisms. The food and water will usually be fine since it comes out of the replicator. There might be spaceborn viruses but if some of them enters the ship, there is probably a hull-breach or something (open shuttle-bays are protected by forcefield). The air should be well. Even if I don't know this for sure, Beverly mentions in one episode, that she can't infect someone due to air treatment in sickbay. It is conceivable that with that technology the air all over the ship is at least constantly monitored of harmful organisms.
All in all this does not mean that nobody will ever get sick. But it guarantees, that no-one will get sick if all works fine. If not (e.g. hull breach, transporter malfunction, unknown viruses, infected replicators, suspicious cargo), then someone might get a headache. So if someone sneezes, "doesn't feel so well", is inexplicably tiered, feels shaky, there is no way, that he can "just lay down and have a good nights sleep". He is to go to sickbay asap! All officers report to the bridge! All non-essential personal must stay in their quarters. We have a crises here, man!*
So why is everyone calm if someone gets sick as if that would be the most natural thing on a spaceship?
*Usually the plot agrees with my reasoning: If someone feels a little sick it usually means, that soon only Spock, Data, Odo or the Doctor will be able to perform any duty.
EDIT: To formulate the question more specific: Are there any harmless reasons to have e.g. a cold on a ship. And if so: Are those harmless incidences more often than the those that mean trouble? Since that would need to be the case if a responsible reaction to someone sneezing is sending him to his quarters.
FINAL EDIT Based on the reaction to sickness ("Go to your quarters" instead of "Red Alert!") it still must be verry common to get sick. So there are limits to the sickness-preventing technology. I wondered, what they are, where the weak links are located... I have no canon-based answer to that and appearently it is felt, that nobody has. So I withdraw this question.