There’s 10 duties of kings (protecting people, eliminating poverty, crime etc). See more in DN27. Then there’s 10 qualities an ideal king should have (generosity, slow to anger etc). If we have a moral ruler, we have a moral country as people take inspiration and examples of morality from the ruler. If we allow killing of tyrants as a way to remove rulers, we allow for chaos in the world. The good people dares not take office for fear of being killed, the bad people end up getting into it more.
In general, I see superhero morality as a good comparison. Buddhist morality is in general superior to superhero morality. However, if even in superhero morality, there’s superheroes who wouldn’t break certain rules, how could Buddhists stoop lower than that? Batman (at least the version I grew up with, eg. Batman begins trilogy) wouldn’t kill the Joker, even after the Joker apparently killed Jason Todd (the second robin), paralysed Barbara Gordon (Batgirl).
There’s personal kamma of killing, which is bad in the long run of samsara, there’s also the societal-political kamma (causation) which can tolerate or intolerant towards certain classes of actions. Many superheroes kills (including the Jedi from Star Wars), that created some expectation of superhero morality works, however, we can always compare superheroes to Buddha.
The Buddha didn’t kill the king who took revenge on the Sakyan race who insulted him. The Buddha tried multiple times to block the road when the prince was leading his army toward, out of respect, for many times, the king turned back the army, but eventually this strategy failed. The Buddha with his psychic powers could easily be like superman to one person by force or violence stop the army. Why didn’t he resort to that? He’s enlightened, there’s no way for him to create bad kamma from that.
He had stronger compassion towards the later generations, compared to his kinfolks. Buddhism as a religion wouldn’t take off if there’s such a taint on the purity of conduct by the Buddha. He is giving an example for later generations to follow, as he knew personally of the many evil consequences of the kamma of killing in one’s personal journey in samsara.
How the general morality of the world behaves depends on how each leaders of countries behave. We believe in being more civilised than war times and the past, with this period of rare long peace in the world (76 years after world war 2). It could take an assassination to trigger a world war (world war 1).