Problem here is Hamas is a terrorist group who operates within the civilian population and uses a range of civilian infrastructure to launch attacks from.
It's a classic modus operandi of terrorist groups globally and Hamas is a hybrid threat. Meaning they threat Israel's security not just through direct attacks, but by using civilians as shields. That creates a serious dilemma for Israel for obvious reasons.
If Israel don't attack, Hamas will strengthen and launch attack after attack. Hamas will be able to protect their assets, i.e. members and weaponry.
If Israel attack, they risk losing support within Israel and the international community.
For Hamas, it's a win-win scenario. But for Israel it's a lose-lose one.
Hamas rely on global audiences not understanding the actual context of why Palestinian deaths are much higher than Israeli ones.
NATO StratCom COE, NATO Command, United Nations and various governments around the world understand the reason for high Palestinian deaths is largely because Hamas operates amongst civilians and launch rockets from civilian infrastructure. The UN has said before they've found Hamas storing rockets in UN schools as well as digging tunnels underneath them to transport explosives whilst children are playing above ground.
All of that is illegal under International Humanitarian Law.
Hamas' hybrid threat is also in the form of a propaganda war. They like to use what is known as useful idiots to build support against Israel. These people are often not well informed on what Hamas actually does.
It's no surprise Hamas plan to murder civilian hostages. They've abused Palestinian and Israeli human rights for decades now.