So a theory I've heard is this.
Islamic Jihad launches one of it's larger rockets. Israel intercepts with Iron Dome. Iron Dome explodes by proximity, damaging the Islamic Jihad rocket, killing it's motor/engine, but not destroying the rocket itself. Debris from Iron Dome rocket causes the first, smaller explosion. Islamic Jihad rocket impacts soon after, thus bigger boom.
If
@Rei is Shit. is correct, and there were two distinct explosions, it could literally be both of their fault. However, Hamas got cameras on the ground REALLY quickly (as if they have some sort of presence very close. Hmmmmm) and were tossing numbers even as the fires were raging about "muh dead 500". I don't really putting blame on Israel for shooting down a larger rocket early, rather than risking it crashing over Israel. Plus, good odds radar tracking had the larger rockets noticed and targeted. I'd still put the blame on Islamic Jihad firing rockets from a civilian area, flying over a civilian area, to target civilian areas.
I don't see the Israelis purposefully targeting the hospital. They did want the hospital vacated of civilians (because you know 100% Hamas will attack from it when the time comes), but bombing it because...."lol we warned you" doesn't seem to mesh well with their desire to try to not just murder Gazans wholesale with evac strategies and knockknocks.