Also, the public would have demanded it because of a desire for revenge for Pearl Harbor, the Bataan Death March (The POW camps had been liberated and previous Intel was verified by then!), defense of Manila atrocities etc. Yes, revenge is not a highly moral position, but it was there and was likely part of the calculation.
It would have been much much worse for everyone if the bombs hadn't been dropped or the coup had succeeded. Atomic bomb production was roughly 3 a month. There would have been more atomic bombings to support the landings and the advance inland. With no doctrine of how to advance through radioactive areas (What was known was either highly classified or plain wrong!) thousands of US\Allied troops would have a developed radiation sickness as well as Japanese civilians. Again, the decision made was the best that could be made out of a whole set of much worse decisions.
Always easy a generation or two after the fact to climb up on a self-proclaimed high moral perch look back and condemn. The people who do that weren't there, aren't subject to same pressures and have the bias of historic knowledge.
I recall a few years ago, liberal comedian Jon Stewart was discussing the atomic bomb. He opined that we should have dropped a bomb offshore, to shock and awe the Japanese about the power of the bomb. And then, according to him, we should have told the Japanese that if they don’t surrender, then the next one would be dropped on them.
As you note, it’s easy to look back with decades of hindsight and say we shouldn’t have used atomic weapons, due to showing superior morality and all that, as some here have noted.
Also a problem with the demonstration idea was a fizzle. What if bomb number 2 with its new technology somehow failed or fizzled. One component goes wrong and its nothing. The Japs laugh and get a morale boost!
As Paul Tibbetts said, they never had their balls on the anvil.