Not really logic, but one can see how it inflames people. It is rather circular too, but I'm sure Hamas must have known what the Israeli response would be this time. I've not seen any interviews of Palestinians expressing sadness over the Israeli deaths.
I feel that's one of the main reasons Hamas did it. Inflaming tensions on both sides benefits them, and as explicit Jihadists they're hardly likely to consider their own longevity as a factor. It's a dangerous thing to be someone who feels that a) deaths of innocents is justified, and b) your own death in service to this specific goal is actually desirable.
Oh, and being MASSIVELY antisemitic helps, too. Can't forget that.
As per usual, when land is at stake, and decisions are made to parcel such up, we usually get problems down the road. And this is made worse because of religious issues attached to such things.
I think that there are two things we can and should avoid doing above all else:
1) We must not conflate the violence committed by either Hamas or the Israeli government to the people, nor conflate acts of Hamas terrorism against Israeli civilians as revolutionary acts (I have seen a lot of this on the left, unfortunately...).
2) Commit ourselves to the idea that violence is always inevitable, or that peace between Israel or Palestine is impossible due to the complexity of the issue.
I think once we meet criteria 1 and 2, we can then go on to talk about and maybe even address potential solutions to historical injustice. Right now, it feels like one side is so outraged by Hamas they can barely acknowledge the humanity of the Palestinian people, and the other side is so resigned to Palestine's doom that they unironically see Hamas as revolutionary fighters against Israeli oppression.
I'm not optimistic about the situation, but I believe there is a virtue to persevering despite pessimism.