Japan was fighting total war. Just like Russia, nuking their cities was a perfectly valid way to destroy their economy. And as it happens, it convinced them to surrender.
You know, the firebombings actually killed more people... Funny you don't mention that...
As for Iraq, it was Iraqi extremists who killed the most Iraqis, by far: https://en.wikipedia.org/wiki/Casualties_of_the_Iraq_War