There are no more hospitals in Gaza (because Israel destroyed every single one). And they have yet to show any evidence of Hamas using the hospitals as military bases.
It might have actually encouraged the use of hospital resources for millitary aims, because now that the hospitals can't use them, it's come out that Hamas is moving the hostages in commandeered ambulances.
Israel literally incentivized and made more possible the war crime they claimed they were trying to punish Hamas for committing in the first place.