It was after midnight when Cuba announced that Fidel Castro had finally died at the age of 90. Despite the late hour, hundreds and then thousands of Cuban-Americans poured onto Calle Ocho in Miami's Little Havana. Some sprayed champagne and others danced to the rhythm of the night to celebrate the death of a man who, in many cases, had forced them or their relatives to flee their beloved homeland, and who perhaps imprisoned or even executed their loved ones.

Still, from a distance, the party seemed a little odd. After all, the retired dictator had survived a bungled invasion and roughly 600 assassination attempts, from the mundane to the ridiculous, to die of old age -- outliving most of his contemporary enemies. Fidel left Cuba and the world he revolutionized, for better or worse, the same way he did everything else. On his own terms.

The U.S. president-in-waiting, Donald Trump, ripped Castro as a tyrant, issuing a statement that "Fidel Castro's legacy is one of firing squads, theft, unimaginable suffering, poverty and the denial of fundamental human rights." Our friendly neighbor to the north, Canada -- well, its friendly prime minister, Justin Trudeau, anyway -- had a slightly different take. Trudeau called the former Cuban strongman a "larger than life leader who served his people for almost half a century. A legendary revolutionary and orator, Mr. Castro made significant improvements to the education and health care of his island nation."

Here's what people have a hard time saying about Fidel Castro. Both of those things are true.

That said, it's hard to get that excited about Castro's good, when the bad is so bad and the ugly is so ugly. For most of the 50 years that he ruled the Caribbean island with his iron fist, Castro stood against many of the values that I -- and anybody who believes in liberty -- believe in. And that starts with my own profession, and the notion of a free press. For more than a half century, Cuba has been the most repressive regime in the Western Hemisphere in its treatment of journalism and dissent; criticism of Castro and other government leaders was forbidden, as were articles that did not stick to a strict socialist storyline, and journalists who tried to do otherwise were harassed or jailed. Human Rights Watch notes in its 2016 report that "(o)ther repressive tactics employed by the government include beatings, public acts of shaming, and the termination of employment."

Still, that's an improvement over the early years of Castro's reign, when political opponents more frequently faced the firing squad. Some Cuba experts say that as many as 30,000 people or more were killed by firing squad during Castro's reign, many for alleged crimes that were political in nature. That is simply unconscionable. (Cuba remains one of the few nations in the world with the death penalty, along with other authoritarian regimes, and, for some insane reason, the United States.)

There are "reasons" for such ruthless behavior. Fidel and his most trusted adviser, the infamous Ernesto "Che" Guevara, saw how the United States had used the Army and other state institutions to overthrow leftist governments, and were determined to avoid the same fate, especially after the U.S.-sponsored invasion of the Bay of Pigs in 1961. But reasons melt into lame excuses. Castro may have been the perfect picture of a revolutionary, but he lacked either the vision or the guts, or both, to uplift Cuba's downtrodden people and to also bestow fundamental freedoms.

The Castro conundrum, however, is that unlike many of the other authoritarian rulers of the 20th Century, Fidel actually did invest some of his revolutionary capital in programs that were intended and -- despite a lack of material resources -- often succeeded at offering basic services to all of Cuba's citizens. As Canada's Trudeau pointed out, the Castro regime had actual achievements in the areas of health care and education.

On the education front, all schooling in Cuba, including college is free. The government spends more of its national budget -- 13 percent -- on education than any other, and the World Bank (not a hotbed of socialism, last time I checked) rates Cuba's learning system the best in Latin America and the Caribbean. The adult literacy rate in Cuba is reported to be at or near 100 percent (compared to 86 percent in the U.S.)

Cuba also reports a lower infant mortality rate than the United States (according to the CIA, for what it's worth) and its citizens enjoy an average life expectancy that is comparable to Americans and other developed nations. One reason for that is because Cuba produces as many or more doctors per capita as economically advanced nations. But Cuba clearly is not economically advanced, even as we continue to debate how much of that poverty is the U.S. trade embargo and now much of that is socialism's inherent flaws. Doctors are not well paid, and crucial drugs are not always available. But a much bigger question looms over Fidel Castro's legacy:

Is it possible to have the basic human rights of good health and a good education...and also the basic human rights of free speech and free assembly?

I think often of the political evolution of Sen. Bernie Sanders, whom I studied extensively for an e-book last year. His youthful enthusiasm for Castro's vigor, at the dawn of the 1960s, is what caused Sanders as a college sophomore to reject both major U.S. parties and become a socialist. But Sanders evolved into what he called a "democratic socialist," and why wouldn't he? The type of old-school repressive socialism practiced by Castro was an abject failure. There were much better nations to study and emulate: Scandinavian democracies that manage to value personal liberty and the essential nature of learning and good health at the same time. Fidel outlived his enemies, but he did so as a relic of a past that's best forgotten.

It will be fascinating to watch the next couple of years, to see if Raul Castro honors his promise to step down in 2018 and if Cuba can add a layer of democracy to what it's achieved so far in social services. That won't undo Fidel Castro's tragic legacy of firing squads and repression. But it will only compound that tragedy if the naysayers here at home wave the bloody shirts of Castro's grim history as a lame excuse to stop pushing for the kinds of universal health care and college education that poor and middle-class Americans so desperately need.