I have - over the years - gone back and forth on the moral ambiguity of this issue. I often wondered if the argument that it ended the war abruptly and prevented an extended invasion of the mainland, which would have resulted in more dead.
I've concluded within just the last couple years, by arguments coming from JAPANESE sources - that yes, it did keep many more from being killed and cities being destroyed by war. Actual conventional bombing campaigns on the mainland were killing nearly as many people as the Hiroshima blast. The use of nukes slammed the door on it. Japanese culture is LOATHE to surrender and the bombing made it clear that it was pointless to continue.
Good thing, too. We only had less than a handful of bombs.