Yeah, but flattening a building generally negates any booby traps it might have contained.
Except Hamas read Ivan’s field manuals from Stalingrad and apparently they have an enormous network of tunnels and bunkers under Gaza. Flattening Stalingrad didn’t help the Germans much in WW2, after all - and it remains to be seen if current technology as Israel currently possesses is going to be able to overcome this, or if all flattening Gaza is going to do is give the rats cover in the rubble.