cost/benefits analysis
individually they didn't deserve it but after okinawa it was clear that mass suicide attacks and civilians being thrown over cliffs rather than allow them to be captured by the americans were just going to continue without something drastic
when i say "deserve it" i don't mean those kids in your grave of the fireflies propaganda individually did something so horrible to be nuked it but truman did what was unpalatable but probably necessary to prevent something even more drawn out and gruesome
the best arguments against are in the soviet telegrams btw but nobody besides a few lower level diplomatic corps officers on the american side knew about those at the time, and it wasn't clear that that was going to change any time soon