Israel had a right to respond but Its not a conventional war though. It’s not WW2 and the Nazis. Hamas are terrorists not an army. Its unlikely Hamas will surrender anymore than the Taliban did. They have shown a long history of willing to see their own people die. Each day Israel bombs Gaza with no Hamas surrender the international pressure will mount. Even in Israel internal pressure will mount. in the war of public opinion this will make israel look bad even though they are right to go after Hamas.
IMO what needs to happen is Israel has to, very publicly, offer a cease fire to Palestinians only if they present representatives other than Hamas to negotiate (i.e. putting a wedge between Hamas supporters and other factions To completely delegitimize Hamas) This puts the issue of relief in the hands of Palestinians. If Palestinians choose to go with terrorists, that looks bad on them in the war of public opinion. If they choose leaders that show some semblance of sanity this opens the door for peace.