Let’s remember that Mu’awiya was raised in Mecca by clan chief Abu Sufyan and his wife, Hind. Hind is the woman who paid a slave to kill Muhammad’s kinsman at Uhud, and then cut a piece from his liver and ate it. After the fall of Mecca, the family begged mercy from Muhammad, and Mu’awiya not only professed Islam but became a scribe for Muhammad. Within a short time, he followed his older brother to the war in Syria, but he never went home. Apart from two years as Muhammad’s scribe, he spent his life in the home of a pagan chief, then at war, then as a powerful regional ruler. He knew enough about Islam to use the right words, but nobody considered him pious.
When people are unjust to someone, they often justify it to themselves by become even more unjust. Mu’awiya began publicly cursing Ali and his memory in the mosque, where as Caliph he was expected to lead prayers.
The other side of the story is that Mu’awiya had a genius for administration. He knew how to use power. In Damascus, he hired Christians, allowed the churches much freedom, and repaired Roman baths. His regime was viewed as at least as good as the previous Roman one, so the Christian majority was not tempted to cause any trouble. He made friends and alliances with existing rulers, using money freely as needed. He appointed governors who were worldly enough, like himself, but had clan ties that kept them loyal. For example, he sent an old Meccan to Kufa, but this man was not one of his relatives, he was from a wealthy tribe in the Meccan area. He didn’t choose as Uthman had, just among his family.
He dealt creatively with one Ali-backing rebel, Ziyad, who holed up in an old Persian fortress. It’s classic Mu’awiya: first he threatened to kill Ziyad’s three young sons; then, after a reluctant submission, he rewarded him by legitimizing Ziyad as his brother (the mother had been a prostitute, so that was up for grabs). Mu’awiya had chosen his favorite well: Ziyad governed Basra and eastern provinces with intelligence and loyalty. He also cruelly suppressed pro-Ali movements, although he himself had first backed Ali. I guess there’s no hater like a convert who used to be part of the target.
What we see is the (I think inevitable) crack-up of Muhammad’s ideal of a ruler in both secular affairs and faith. Had Ali been the first Caliph, the empire probably would not have happened. He would have focused on turning a united Arabia into an ideal faith-based society, and I don’t think that would look like Wahhabi Saudi Arabia. But with the rapid expansion under the actual first three Caliphs, the empire had grown such that pure faith was not enough as a job skill. Mu’awiya was in some respects a better secular ruler than Ali could have been, while Ali was a vastly better faith leader. To our modern minds, it seems simple: just divide the roles. But they weren’t there yet.
In 662, Armenia became a tribute-paying vassal of Mu’awiya, so that Armenian troops began fighting alongside Arabs, where previously they had been the backbone of regional Roman power. Muslim and Christian Armenian troops began raiding farther and farther into Asia Minor, while a growing navy assaulted Roman targets around the sea. In 668, Arab ships were in the Sea of Marmara and land forces set up the first siege of Constantinople. It didn’t last long, but it’s remarkable that Mu’awiya pulled this off so soon. The loot hauled in by these lightning raids cheered the morale of his fighting men, so it was a relatively cheap way for him to become popular with the army. On the other hand, by the end of his reign, Mu’awiya had to negotiation another truce with Constantinople. He had over-reached. The next Caliph would inherit a duty to pay tribute!
Mu’awiya’s oldest son was named Yazid. His mother had been a chieftain’s daughter of an Arab tribe in the Syrian region. They were among the Arabs who had become Christians under Roman rule. Yazid was thus a good candidate to rule Syria as a king, which is essentially what the office of Caliph now became. In 676, an ageing Mu’awiya named Yazid as his heir apparent, violating his agreement with Hassan to set up a shura. In Medina, his second cousin Marwan viewed this move sourly. No fan of Ali’s or Hassan’s, Marwan could have used the shura process to confirm himself as successor.