There's no evidence the hospital was being used for military purposes (as in, rocket attacks or munitions storage) or that Hamas was "occupying it". I've seen attempted justification from IDF supporters being that they were treating injured Hamas fighters, but to be honest the officials are staying pretty mum on it so who knows.
Hamas is as much to blame here as Israel, as they're the ones who are using the hospitals for military purposes in the fist place.
No, no, I'm pretty sure the person who throws the bombs and actually blows up all the mothers and injured and sick people is more to blame than the people who are trying not to get blown up, as bad as those folk might be. Either way, Israel is most definitely still
too blame, which the Palestinians civilians and medical workers killed aren't.
If you want a feeling for what it's like on the ground, here's a video of a crew working to recover wounded, when an unknown sniper starts opening fire on them, killing one and keeping the others hunkered down amid the rubble.
http://electronicintifada.net/blogs/ali-abunimah/war-crime-video-shows-sniper-killing-wounded-gaza-civilianEdit: Seen some criticism it might be faked in some way. Take with a grain of salt.
Edit:
If a bunch of mafiosos hid out in a hospital in Chicago during the anti-gang efforts, and the US government responded by bombing the place to rubble, do you really think people would be saying things like "well, the mafiosos were just as much to blame as the US government for hiding there"? Or would people simply be (rightly) pissed at the US government for deciding killing a whole bunch of innocent civilians was worth getting the bad guys, even if the bad guys were pretty much incapable of ever causing that much death and destruction on their own? If people did start talking about how the mafiosos were equally to blame when people tried to talk about how terrible it was, what would you think of those people?