I have a daughter with cerebral palsy. She occasionally will end up in the hospital and we won't tell anyone for a while. I struggled to explain why we did this, until I came across this great article.
Basically, the idea in the article is this: put the individual affected at the center, and draw concentric circles around that person according to how intimately connected others are with the affected person. So a spouse would be in the first level, immediate family the next level out, then intimate friends, then "work friends," and so forth.
The rule is "Comfort IN, dump OUT." So if the purpose of something you're going to say or do is to help yourself feel better, you're only allowed to say it to someone further out of the circle than you are. If the purpose is completely unselfish, you're allowed to say it to someone further in.
While comforting someone in and of itself certainly meets the rule, breaking a confidence and not respecting a desire for privacy doesn't, as it places your own desire to express your feelings over the desires of people further inside the circle.
The reason people with serious illnesses often want privacy is it puts them in the position of repeatedly providing "comfort out," even if unintentional. You end up explaining your condition over and over again, reliving people's shock over and over again, and it's often really hard to extricate yourself from a conversation until the other person is assured you're not about to drop dead if they leave. You're just one person, but remember there is someone else waiting to talk as soon as you leave. This is demanding and exhausting.
Your coworker is not an idiot. He knows people can tell he is ill, and trust me, he knows you care. You are showing more caring by giving him some space.