I mean, that makes a certain degree of sense, because if using protected places as a place to put one’s military operations doesn’t remove that protection, then it would become a common strategy to intentionally use vulnerable civilians as shields in that manner, and since no military is realistically going to just let their opponent attack them without a response when capable of delivering one, such a scenario would just lead to the whole idea of places like hospitals being protected being abandoned.
Except in theory, you would want your hospitals protected regardless, even if it wasn’t a war crime to hide the military there. Because that’s where your population is vulnerable and being healed.
Using your own population as shields is just next level. Those are the people you are supposedly fighting to protect in the first place.
I don’t mean protected in a military sense, I mean protected in a legal sense, ie, assuming your opponent is bound by international law, having them forbidden from attacking those places. In a more normal conflict, it’s in the best interests of both governments to follow this sort of rule, since the military value of a hospital is (supposed to be) kept low, and each side knows that attacking medical facilities might lead to the other side doing the same in retaliation. However, this isn’t really a normal conflict, and Hamas does not act like a state (since it isn’t really, it’s a terrorist group taking on some of the roles of a state).