not literally every Palestinian is a member of Hamas.
Killing civilians would still be wrong even if they were.
You say you don't understand this thinking? Well you're half way there by accepting that murdering civilians is ok if they're part of "the bad guys". The next step is just extending who counts
"Never believe that anti-Semites are completely unaware of the absurdity of their replies. They know that their remarks are frivolous, open to challenge. But they are amusing themselves, for it is their adversary who is obliged to use words responsibly, since he believes in words. The anti-Semites have the right to play. They even like to play with discourse for, by giving ridiculous reasons, they discredit the seriousness of their interlocutors. They delight in acting in bad faith, since they seek not to persuade by sound argument but to intimidate and disconcert. If you press them too closely, they will abruptly fall silent, loftily indicating by some phrase that the time for argument is past."
Politics must be so easy when you just lazily strawman everyone who disagrees with you, before writing them off with an equally lazy adhominem.