The executive summary is: standing next to a CCed target makes it more likely it will attack you when the CC breaks, rather than going for the CCer.
Lume the Mad has a good post introducing the concepts of Threat and Aggro which I recommend reading. It is useful to know about threat to understand the following!
So Lume says if you are standing in melee range of a mob, you must exceed 110% of the threat the mob's target has to pull aggro, at which point the mob will come for you. If you are outside melee range, its 130% threat. From Wowwiki, melee range is 5 yards or closer.
Consider the case of a hunter chain trapping a mob. They will lay a trap and try to get threat on their mob, so it runs straight for them and into the trap. The mob will get trapped and will have to stand still and think about their actions. At this point no one is damaging the mob, so who is gaining threat on the mob?
Generally it's the healer. The mob is annoyed with the tank so every time the tank gets a heal, the mob becomes a little more annoyed with the healer - the healer is gaining threat on the trapped mob. When the mob breaks free from the trap, the healer has gained extra threat on the mob from when it went in. The trapper on the other hand usually has gained no extra threat on the mob at all (unless they have been drinking potions or healing themselves).
When the mob breaks out of the trap, if the healer has 111% of the trapper's threat one of two things can happen. If the healer is standing out of melee range of the mob, the mob will still go after the trapper, because the healer needs 130% threat to pull aggro. If the healer is standing inside melee range... the mob will go after the healer, because when in melee range, the healer only needs 110% threat to pull aggro. Melee range being next to the trap.
So I think that's why its a bad thing to stand next to a trapped or shackled mob and merrily heal away. I could be wrong of course ;)