Five things:
1. Laws have changed concerning bombings. Bombs have gotten more precise so they can cause less collateral damage.
2. Again, this is military law, not civil law. If you or I were to launch a missile at a city, whether it's a country our nations are at war with or not, we would be prosecuted for multiple counts of homicide, and probably an act of terrorism, not to mention illegally owning and operating weapons systems, etc...
3. Collateral damage has its own set of laws governing it, in which only official members of the armed forces are authorized to clear the launching of a missile or the dropping of a bomb. There are long investigations into any operation involving collateral damage, and the more extensive the damage, the more intensive the investigation.
4. Any persons harboring combatants or leaders of enemy armed forces are deemed to intend harm to armed forces members. If you are fighting in an urban area, you are governed by the military rules of engagement, which prohibit firing at non-combatants, among other things.
5. While the launching of a missile or dropping of a bomb is intentional, the purpose is not to inflict collateral damage but to take out a target, whether that target is an enemy leader, production facility, or something similar.
And, before we go into specifics, I don't believe the use of nuclear weapons was justified during WWII, nor do I believe nuclear warfare will ever be justified. Bombing entire cities of civilians to make a point in a war is no better than terrorism, imo.