As awful as nuclear warfare is, people tend to think the moral calculation is easier than what is actually the case. For those unaware what was going on in China at the time:
Under Emperor Hirohito, the Imperial Japanese Army (IJA) and the Imperial Japanese Navy (IJN) perpetrated numerous war crimes and crimes against humanity which resulted in the deaths of millions of people. Estimates range from as low as 3 million to as high as 30 million victims. Various related crimes include sexual slavery, massacres, human experimentation, starvation, and forced labor directly perpetrated or condoned by the Japanese military and government. [...] The Imperial Japanese Army Air Service took part in conducting chemical and biological attacks on civilians during the Second Sino-Japanese War and World War II.
The bombings of Hiroshima and Nagasaki, which were the only things stopping this onslaught, caused between 129,000 and 226,000 deaths. this puts them (individually) in the ball park of the bombing of Tokyo (using traditional bombs).
There's a very solid argument to be made that nuclear bombs should never have been deployed, or developed for that matter. But the calculation of good and evil is a lot more complicated than people tend to accept.