Hamas hides behind civilians, yes. They doesn’t make killing the civilians right. It makes both sides wrong. Hamas is a terrorist organisation. This is not a war as the west bank doesn’t have an army. Israel prevent them having legitimacy as a country. One consequence of this is paramilitary organisations.
When a terrorist takes hostages, we don’t bomb the hostages to get them out. We kill the terrorists if possible and try to free the hostages.