There is a difference between recommended khilafa and accepted Islamic government out of necessity in order to maintain unity within ummah.
There is no doubt that true Khilafah was of Prophet Muhammad SAWS and his four successors and other than them Sayyidina Hassan RA's short rule and the rule of Umar bin Abdul Aziz RH. Other than them there were good monarchs and bad monarchs but the institution of khilafah got corrupted after the appointment of Yazid. Instead of leadership on merit it turned into leadership of inheritance regardless of the capability of the person. This nepotism based system of government i.e. monarchy is the reason behind the instability of ummah all these centuries and this is why Ottomon Empire got so weak that it eventually crumbled and completely collapsed.
The traitors, the munafiqeen, the kuffar are just outer symptoms for the collapse of Ottomon Empire. In reality the problem had started way back in the times of Yazid when he was appointed as the Emperor of Muslims. Here I am not saying anything against Sayyidina Mauwiyah RA and other Sahaba RA. They had to take decisions to the best of their judgement and I am not questioning their wisdom or doubting their faith (Nowudhubillah). However, the point I am trying to make is that monarchy can't be equated to khilafah in no sense. Yes due to majboori (out of necessity) if ulema compromised and accepted the monarchs as khulafa then that is a separate thing.