There's a rationale...
They want to kill as many Palestinians as they can.
And they know shit like this just creates the next generation of Hamas. So Israel gets to keep doing this for decades. The worst thing that can happen to Netanyahu and his party is lasting peace.
Before 10/7 there had been talks for months about how he was going to lose power.