The answer is dependent on context I think.
In a universe where the whole future of the world is laid out before you and you can choose 1 death or many deaths, then sure, pick the greater good.
The weakness of simplistic “greater good” automatic arguments is that in a real universe it opens you up to manipulation.
In the end, there’s no avoiding thinking through the incentives from all perspectives. And that indeed suggests not giving in to the rioters, to protect the integrity of the entire legal system and reduce the risk that every trial becomes a show trial dictated by whoever has the biggest mob.


Well that sucks. My favourite moment in a hidden role game was when a player won by misreading their card and convincing both of us that we were allies at the start. They ended up the only evil player for most of the game and then in the last round after we’d worked together to systematically kill everyone else (all weirdly innocents, we were both feeling guilty by this point), when they finally realised they knew there was no evil player they checked and… killed me. Total madness and a glorious victory for them. How can you be mad at that?!