At the time Nuking a country wasn’t a war crime. Also fire bombing raids on other cities (eg Dresden) were actually worse than the nuclear bombing. Additionally it could be argued that the nuclear option actually killed fewer civilians than the alternative.
Strongly recommend Dan Carlins podcast on the rise and fall of imperial japan to learn more.