The problem people have with Israel is not that they're killing Hamas fighters or that IDF soldiers are being killed. It's that they're killing civilians (amongst other war crimes and crimes against humanity).
It's a completely different situation.
Edit: just to flesh out my position here a bit. Civilian deaths are unavoidable in war. But the attacker _must_ take measures to prevent that as much as possible. Israel have not. In fact they've done the opposite.