"How Can Latin American 'Revolutionary' Leaders Support Gaddafi?"
Because they very much enjoy annoying the Americans.
"And how on Earth can Castro, seen by many as a voice of national liberation and social revolution, refuse his support to the overwhelming majority of Libyans in their battle for freedom?"
See the answer above.
I may be thuggishly reductionist here, but I think it really is that simple. If the scenario in that bloody awful film Armaggedon - Barrack Obama sending Bruce Willis to destroy an asteroid that threatens to wipe out all life on Earth - ever played out in reality, Hugo Chavez would probably cheer for the asteroid. He might even offer it a cut-price petrol deal into the bargain, because he's just that kind of guy.
It's worth recalling that the likes of Chavez or Ortega are, in large part, popular with so many of their people precisely because they devote so much of their time to coming up with new ways to annoy the Americans. Frankly, I'd expect a bit more out of my head of state, even though ours spends half of her time wringing pheasants' necks, eating swans and other such cruelties to anything feathered that has the misfortune to cross her path.
Nonetheless, if the modern Latin American strongman prefers to spend his time woofing at the United States rather than, say, hosting Soviet nukes or hurling his nation into murderous civil wars, I'd say that we're getting off pretty easy. After all, the more time Chavez spends boring his citizens to death on Venezuelan TV, the less time he has for poking Colombia's twitchy military with a stick.