Beyond saving hundreds of thousand of Allied soldiers, using nuclear weapons on Japan saved millions of JAPANESE lives. The conventional Allied bombing in preparation for invasion would have laid waste to the entire country. (Indeed the conventional firebombing raid on Tokyo killed more civilians than either nuclear strike). And the Imperial government was training civilian (women and children) suicide squads, and Japanese civilians had already conducted mass suicides in the face of capture in places like Saipan.
Out of available targets [1], even taking into account air defense, neither Hiroshima and Nagasaki seem to fit the narrative of the US aiming for maximum civilian casualties. And especially given that Kyoto was struck from the Nagasaki target list as being too culturally significant.