But I don't agree with those who believe that (say) the US invasion of Normandy can be justified, but this invasion cannot be justified. Both involved immense civilian suffering.
Hamas did not invade Israel. What are you talking about? They didn't try to take over territory. They committed an act of terrorism, not an act of war.
A missile strike is a legitimate casus belli. If you're not a pacifist, that means it justifies force to achieve a military objective, which necessarily justifies killing civilians.
Whether that's "countless" or a few depends on the objective.