All sides of the Palestinian conflict have strong groups of influence who base their demands on religious grounds, because when you cannot deny facts or do not want to start a long, hard road to peace and reconciliation saying "my made up deity told me so" is apparently reason good enough to start killing people.
Religion is a red herring here. What must be done first and foremost is Israel, the party with all the power here, treats all people equally, with equal rights. Doing so will take the wind out of the sails of Hamas. If Israel's goal is genocide, an independent investigation of Israel's actions will show that they are different*.
* - An independent investigation of Israel's actions shows that they are different.
Because of this, anyone involved in the Israeli abuse and genocide of Palestinians is as extremist, if not moreso, than those involved in the attack that killed 95% fewer innocent civilians last year.
Either way, the first step is that Israel must stop treating Palestinians as half-people. It's the right thing to do, and it will take the wind out of the sails of Hamas, as well as the global condemnation of Israel.
> They took Palestinians hostage and used them to turn the world against Israel.
This is the gaslighting language of spousal abusers: "You made me hurt you". Israel did both those things, and is (unsuccessfully) attempting to gaslight others with abuser language, because they are abusers of Palestinians.
Israel also has tons and tons religious extremism but it wouldn't be fair to say that Israel fights for religious reasons. It just comes down to an extreme and probably unsolvable fixation on the land from both sides.