I do wonder what you think is going to happen when they 'remove Hamas'? @stomachameleon you can flip your point on it's head: 'If the penalties are clear (which I assume they are) why carry on doing it? Why take the risk that your outcome will be any different?'
Do you think that the 2 million people who have at best seen their homes collapse and been displaced or at worst, have gathered the body parts of their friends and families into a carrier bag and buried their babies are going to think 'Well, October 7th brought this on our heads, we must now admit that our ideology, religiosity, value and belief system, way of life, and ties to place just don't work. Israel has finally taught us the error of our ways, they had a right to defend themselves and they have a right to a sovereign state'?
Israel's current military and settler behaviours will do to Palestinian civilians EXACTLY what Hamas military action on October 7th did to Israeli civilians. Your point about outcomes and why carry on doing it can be applied to Israel's strategy: 'If the penalties are clear (continued terrorist incursions into Israel) why carry on doing it? Why take that risk that your outcome will be any different?