Have you seen the Israeli hostage families protest in Israel? They get heckled and threatened by the hardliners in the general public and government who want the war continue to and those hardliners essentially want the hostages as an excuse for war. The democracy in Israel has elected a government that wants to continue to acquire land in Gaza and the West Bank in preference over negotiating for return of the hostages. There are multiple video and text reporting on this issue.
https://www.jpost.com/israel-news/article-847290
There are also hardline hostage families that want to continue the war over negotiating.
https://apnews.com/article/israel-gaza-hamas-hostages-ceasef...
It's complicated and not as simple as your black and white assessment - that people are for either returning the hostages or not returning the hostages and those same opinions are in sync with ending the war/continuing the war with the same priority.
Hamas having hostages serves both Hamas and the hard right wing's long term goals in Israel, and the hard right wing in Israel holds all the power in Israel and Hamas holds the power in Gaza.