I’ll ask again: What is the alternative?
Wars generally don't end with genocide.
Conquered people don't cease to exist. Worst case they are subjugated, but these days they just assimilated/absorbed.
The alternative is perpetual war, or some sort of compromise.
If Hamas surrendered unconditionally tomorrow, what would Israel do?