Your question is a good one, but there are several definitions that need to be clarified.
For a political ruler is it better to be loved or feared (hated?)
It sounds like you mean better for the ruler rather than better for the people. But how do you define "better"? Are you simply asking which ruler has the better chance of staying in power, one who is loved vs one who is feared?
And did you really mean to say "loved or feared" or "loved and hated"? A ruler can be loved and feared at the same time.
Finally, loved or feared by whom? The majority of a ruler's subjects, or a minority that may hold even more power? What about foreign leaders?
In modern history, a number of countries have embraced socialism as an alternative to capitalism, which is commonly seen as a parasite on poor, developing countries. Salvador Allende was the first socialist elected president of a Latin American country. He obviously had popular support in his country, but he was hated by the West and soon wound up dead. He was replaced by a military junta led by Augusto Pinochet, who was a widely feared and hated tyrant. Yet Pinochet spent seventeen years in office and was never prosecuted for a wide variety of heinous crimes.
Salvador Allende's fate was shared by Patrice Lumumba, a socialist who became the first prime minister of the Republic of the Congo.
Under Muammar Gaddafi, Libya boasted the highest standard of living in Africa, but Gaddafi was reviled by the West, which eventually invaded and destroyed the country, murdering Gaddafi in the process.
George W. Bush was one of the most feared and hated presidents in American history. But he was beloved by the plutocrats he represented and served two terms in office.
In contrast, Obama was greeted as a conquering hero, largely because he was a Democrat who replaced a widely reviled Republican president. Yet Obama's policies were a virtual carbon copy of Bush's policies. Still, Obama served two terms, similar to Bush. Obama was loved by many citizens, including the very people his administration sold out.
So here we have two frighteningly corrupt and destructive presidents, one widely feared and hated by the people, while Obama enjoyed widespread support (though he was still feared and hated abroad), both of which were allowed two terms.
On the other hand, a corrupt leader who wants all the power might court the people rather than the plutocrats. Julius Caesar and Caligula were among the emperors who sought to downsize the Senate, at the same time appeasing the masses with entertainment or propaganda.
Towards the end of the Roman empire, authoritarian emperors found themselves at the mercy of the feared Praetorian Guard, who assassinated emperors with increasing frequency. So if a Roman emperor wanted to survive, who did he want to be loved by, the people or his bodyguard?
Politics can be awfully similar to a juggling act.
In summary, political leaders often have to walk a tightrope, appeasing 1) the majority, 2) a powerful minority and 3) other countries. They may even have to deal with more specific entities, like the Praetorian Guard or J. Edgar Hoover. If a modern leader wants to help the poor, boost literacy or protect the environment, he or she needs a powerful bulwark against the almost inevitable attacks that will come from the U.S.