They punished them collectively, but precisely because of that people will be even more radicalized in Gaza in the future, and Hamas will be even stronger in the future, get more recruits, fight even harder, have more extreme goals and take even more extreme actions, etc. This ties into the argument why Iran still didn't do anything, because Hamas is still doing fine, with prospects to become a stronger and bigger threat than ever in the future.
It's impossible to 'destroy' Hamas (it's not a physical tangible thing that you could actually destroy), the highest-level leaders are abroad, most of the soldiers are in the tunnels, etc, setting such unrealistic and idealistic goals shows just how much Israeli leaders are delusional. And even if they kill all current soldiers, they would just recruit new ones as long as ideology and leadership remain and they have support from some foreign actors like now in terms of funding/resources.
Egypt already said they don't give a damn about Israelis' plans to push the population of Gaza inside of their borders, they will remain in Gaza, in cut-off territory compressed smaller than before, but still inside of Gaza. Israel's only hope is to find a peaceful resolution or kill all the 2 million people one by one. There is no other way, either kill/expel all 2 million people or accept the 2-state solutions, stop being genocidal.
Honestly, I think Israeli leadership has actually no idea what they are doing right now. In fact, maybe it is just some kind of typical Western-like hubris, or some kind of emotional, hate-driven response. But you can't convince me that they have any strategy or vision. Yeah, some anti-Muslim extremists around the world will keep tweeting and celebrating the genocide, but for the long term, Israel is in a worse situation than it was ever before in terms of security, economy, and international standing (Iran doesn't need to do anything, it's just sitting, rubbing its hands).