I was gonna say the Nazis but then I remembered they had that whole Hitler guy hmm
Jokes aside you're kind of hinting at something Thomas Sowell writes very well on, I highly recommend his book Intellectuals and Society.
His main point in that book is there are a group of people who consider themselves better than the foolish common people. He calls them the intelligentsia, people ranging from your average college kid to noam chomsky (who i was quite a fan of in early life), and especially leftist / communist / collectivist types.
They espouse acting under "the greater good", as if they are the arbiters of whatever the heck that means. But they do it, of course, only to help the poor foolish common man, who hasn't their education or status.
Can be found online on eg. annas archive or buy it, i listened to it on audible it's fantastic.
To really answer your question though, imo if the israelis destroy hamas and take over gaza, even if there is collateral damage, they could be doing it for the greater good and in my (correct) view be right about that.