If you're like the average employee, you're most productive when you're at your peak health. Still, a little progress is often better than no progress. So, if you can prove that cold or flu isn't getting you down, your boss will be glad you did, right?
When you work around other people, your health affects everyone. If one of your co-workers is sick, you probably won't want to be around him much or to touch the same things he's touching. Even if his illness is not contagious, it could still be distracting to hear him constantly coughing, blowing his nose or sneezing.
Your employers don't want something "going around the office," either. If employees are sick or distracted by others who are sick, productivity falls and the quality of work suffers. Sometimes no work is better than substandard work, especially in jobs that require careful attention to detail and little room for error (like surgeons or air traffic controllers).
Sometimes it's injury rather than illness that can impact your job. For example, if you have a broken arm in a cast, you probably can't type well, and if you have a knee injury, you can't walk freely around a busy shop. If temporary immobility is the only thing stopping you from being productive, talk to your employer about other ways you can contribute while you're healing, such as working from home or catching up on paperwork.