Israel trying to destroy Hamas through military means, with the current status quo in place, is good for Hamas. Ergo, it should try to reduce Hamas's power by changing its own domestic civil rights policies. If it combined that with bombing and working with Gazans in good faith, like it did in the 1980s and it built the infrastructure Gaza relies on today, both Jews and Gentiles in the region would generally be safer and Iran would have less of a wedge to use against them.
Israel isn’t perfect but its civil rights record towards Muslims is better than Palestine’s towards Jews.
There's no singular Palestine to speak of here. In my view anyhow, Israel has been effectively in control of the trajectory of the status quo for a while. It defeated Arab states and secured its own existence. It has failed to successfully protect its imperial core completely because it's focused on trying to achieve maximalist goals instead. Which isn't good and leaves an opening for the Iranians.
They sought to close that opening.
Whether or not it's wise to try to remove Hamas wholesale is dependent on this broader picture. History didn't start on 10/7.