How? They lack the organization and military capability to do so.
And while Hamas hasn't done them any favors, with the way Israel has been behaving, I'm not surprised your average Palestinian in Gaza isn't feeling like helping the Israeli objective, even if it likely would be in their long-term interests as well.
The fact that it might make logical sense to you or I that they should is entirely irrelevant. We're not there, and if we were, I doubt we'd be much driven by logic at this point. Not to mention we wouldn't have had access to the internet or regular communications with anyone for months now, and only see the death and devastation.
When the IDF kills (at least) two civilians to every combatant, and then drives many others out of their homes and into starvation, it really does make it look like Hamas is the only organization that will fight for them. And Hamas barely even does that (seeing as they are a terrorist organization that uses Palestinian civilians like sacrificial pawns), but they come far closer to it than any other organization in a position to do anything.
If we want Gazans to support an alternative to Hamas, then we need to come up with an alternative to Hamas that supports Gazans better than Hamas does. That should be pretty easy; it's a very low bar.
It is not the same, but in a sense this odd naivety was a similar surprised reaction to US withdrawal and quick rollover of 'local' army in Afghanistan.
<< We're not there, and if we were, I doubt we'd be much driven by logic
I think this is worth highlighting. edit: The reason to avoid war is because it is horrific and can remove all sense from a man.