A core principle of modern (western) legal states is that it's preferable to let 10 guilty people walk free before wrongfully punishing one innocent. I'm aware that we often don't manage to live up to that, but it is the ideal.
That's why guilt of the individual (!) has to be proven beyond reasonable doubt, it's why certain evidence may become inadmissible if it's been acquired illegally, it's why suspect's may walk free due to formal errors. We try to make absolutely sure that cutting corners doesn't lead to wrong conclusions, even if it means that we sometimes have to let criminals go unpunished.
Following that same principle, "it's possible that there's a significant majority" isn't enough. Where's the proof that there's not a single inhabitant of Gaza who doesn't support Hamas?
Also, since when is it a crime punishable by lifelong imprisonment or death to be hateful of someone?
And if you and your entire people were held in an open air prison for as long as you could think back, would you not grow hateful of your jailers?
Last but not least: The logic that "there are no innocents [on the other side of the fence]" applied by Hamas towards the Israelis led to October 7th. If it was flawed then, how is it not flawed now?