Editor's note: Frida Ghitis is a world affairs columnist for The Miami Herald and World Politics Review. A former CNN producer and correspondent, she is the author of "The End of Revolution: A Changing World in the Age of Live Television." Follow her on Twitter @FridaGhitis.
(CNN) -- Nelson Mandela managed one more victory in death: subjecting a who's who of the world's dictators to the indignity of sitting through a memorial service that overflowed with praise for the principles of democracy, freedom and equality.
It's a pity that so many are focusing on a handshake between President Barack Obama and Cuban President Raul Castro. They are missing the much more poignant events that unfolded during Tuesday's memorial service in South Africa.
Sure, the handshake was noteworthy, maybe even meaningful. But any satisfaction Castro might have found in the gesture, any comfort authoritarian regimes might have drawn from the moment of politeness toward a dictator, dissolved in the far more powerful message of the entire event -- and of Obama's own resonant speech.
You can blame Obama for other things, but don't deny this was a piercing speech, a full-throated defense of democracy and freedom.
That rainy morning in Johannesburg brought no joy to tyrants.
Obama paid homage to Mandela, "Madiba," his tribal name, as "the last great liberator of the 20th century," who "showed us the power of action; of taking risks on behalf of our ideals." And he reflected on the human traits that made Mandela special. "I'm not a saint," Obama quoted Mandela saying, "unless you think of a saint as a sinner who keeps on trying."
Everyone in the audience could nod, recognizing the struggle to persevere in their own lives.
But Obama came not only to praise a man; he came to shine a light on the values that made him worthy of admiration and the causes that made his struggle reverberate the world over. It was a moment for stony discomfort among those who traveled to South Africa representing undemocratic, repressive regimes.
"Like America's founding fathers," Obama noted, "[Mandela] would erect a constitutional order to preserve freedom for future generations, a commitment to democracy and rule of law ratified not only by his election, but by his willingness to step down from power."
Consider who was sitting in the stadium listening to this tribute to rule of law and democracy, to handing power to an elected successor. It wasn't just Castro, who along with his older brother Fidel has ruled Cuba for more than half a century without permitting a democratic election, while engaging, according to human rights organizations, in "repression of independent journalists, opposition leaders and human rights activists."
Along with Castro in the VIP stand, ostensibly honoring Mandela's legacy, sat countless dictators and their right-hand men.
It included the likes of Swaziland Prime Minister Sibusiso Dlamini, representing the small kingdom described by Freedom House as "a failed feudal state," where the king uses photos of beautiful girls to attract tourists, "distracting outsiders from Swaziland's shocking realities of oppression, abject poverty, hunger and disease."
Freedom House says that in the past 40 years, "two despots have used Swaziland for their personal purposes while ignoring the needs of the Swazi people and their legitimate rights to have a say over how they are governed and how the country's resources are used" -- the very antithesis of Mandela's struggle.
Mandela was, indeed, human and flawed. But there were aspects of his life that seemed superhuman. Among them was his ability to forgive his former enemies. That was a part of Obama's message that should have made some of the visiting VIPs cower in shame.
Obama quoted Mandela's words during his 1964 trial, when he said, "I have fought against white domination, and I have fought against black domination." Citing those particular words was like unleashing daggers against the likes of Robert Mugabe, president of Zimbabwe since 1987, who sat in the audience along with scores of celebrities and foreign dignitaries.
Like Mandela, Mugabe led his country to victory over white rule. But unlike his neighbor, Mugabe grasped for power without letting go, and engaged in a vindictive campaign against white Zimbabweans that wrought misery for blacks and whites.
In his speech, Obama didn't leave his audience to unpack the condemnation of the hypocrites that he brought thinly wrapped in praise for Mandela.
He unpacked it all himself and placed it in the center of the arena: "There are too many leaders who claim solidarity with Madiba's struggle for freedom but do not tolerate dissent from their own people," a truth as piercing as the blaring vuvuzelas from South Africans celebrating the life of their beloved hero.
You could list the men, the countries, the regimes, that should have felt directly attacked by Obama's words in a crowd that included envoys from China, Saudi Arabia, Chad, Jordan and many other states whose leaders are not popularly elected and the many others guilty of repression and human rights violations.
Obama called out the hypocrisy, although the truth is that it was inescapable in many of the comments that followed news of Mandela's death.
If we had a prize for the most brazen display of duplicity following Mandela's passing, we would have fierce competition but one indisputable winner.
That would be the Syrian dictator, President Bashar al-Assad, whose statement of condolence was posted on the Syrian Presidency's Facebook page, calling Mandela "an inspiration to the all the vulnerable peoples of the world, in the expectation that oppressors and aggressors will learn..." The statement elicited bitter laughter around the world.
Mandela was not perfect, but there is a reason why his life inspired billions of people and his death brought what might have been the largest gathering of world leaders in modern history. He stood for values and principles that have gained universal legitimacy. Those include the right to fair and equal treatment for all and the right of all people to choose their own government.
The way Mandela lived his life was a call to forgiveness and reconciliation.
It was U.N. Secretary-General Ban Ki-moon who called Mandela "one of our greatest teachers." Like all the best teachers, Mandela managed one more lesson during his memorial service, and it was Obama, the professor, the man whose own career might not have reached the pinnacle, who served as Mandela's principal assistant that day, imparting a much-needed lesson for despots.
Follow @CNNOpinion on Twitter.
Join us at Facebook/CNNOpinion.
The opinions expressed in this commentary are solely those of Frida Ghitis.