In Gaza, Hamas likes to set up their launch sites and operations bases in the middle of busy neighborhoods inside the houses of civilians so that it's damn near impossible for Israeli strikes to not cause collateral damage.
By the way, US soldiers have had a good number of cases of collateral damage as well... It happens when you're fighting an enemy that doesn't play by the rules you do.