Your question and subsequent justifications would be valid under 2 conditions:
a) Gaza was a free state ruled by the crazy Hamas.
b) This entire thing started on October 7 and absolutely nothing happened before October 7.
But that is not the case. The truth is that
a) Gaza is not a free state. It is not even a state. It is territory controlled by Israel by land, air and sea, including basic essentials such as food, water and electricity (which they turned off mind you, which is a heinous war crime). If the Israelis could they would control the air that those people breathe.
b) This is one of the battles in a 75 year old permanent state of war during which, yes the Palestinians have conducted terror attacks. But the Israelis have not just conducted terror attacks but they have dehumanized and violently dispossessed the Palestinians.
The reason nothing good happens to the Palestinians is because the Western World, which is where all the political and economic power is, supports Israel, and enables the brutalization of the Palestinians despite actually knowing what is going on over there.
The Palestinians are the ones on the receiving end of violence and therefore, simply telling them, "Just sit down, stay quiet and suck it up" is not going to work. Any population in those conditions will rebel, and suffer losses at the same time. Its been the case throughout history. The indigenous people went through the same thing here in North America too, until the colonizing forces made peace in a one state solution. Something which Israel needs to do now.