It's easy to condemn a decision made 70 years ago when you don't know what the US president knew the day he made the decision.
In July 1945 relations with the USSR were going south very quickly though the Soviets had agreed to join in the war with Japan as the Allies needed the Red Army to invade Japan. The USSR did declare war on August 9 and with an army built to win a land war against Germany, they went through the Japanese Kwangtung Army in Manuria like a hot knife through butter. The Japanese had all the disadvantages, the war had drained their resources to where the Kwangtung Army, which was once a very powerful force was badly weakened and under supplied. Plus Japan had never built any modern tanks after the mid-1930s and Manchuria is perfect tank country.
The Russians were poised to invade Northern Japan by the end of August and did seize the Kurile Islands before the end of the war. They never gave them back and due to the tension over those islands the Japanese and USSR never formally signed a peace treaty and they are technically still at war, even though one of the countries does not exist. The successor state, Russia and Japan have talked about a peace treaty, but I don't believe one was ever signed.
In July 1945 there was a lot of concern that if the brewing cold war went "hot" the Soviets would over run western Europe. They had the forces to probably do it and the Allies would be hard pressed to stop them.
It was assumed that the Soviets would divide up Japan like Germany was divided up with a "red" Japan and a "free" Japan.
Next the planning for Operation Downfall, the conquest of Japan was very advanced by late July 1945. The expected casualties were staggering. It was expected that about 1/3 of the 400 ship invasion force would be lost before reaching the beaches. Total casualties for the entire operation were estimated to run 1 million Allied losses and Japanese losses were expected to be as high as 10 million. Most of the Japanese losses would be dead rather than wounded because the Code of Bushido (a corruption of the Samurai Code) dictated wounded soldiers should kill themselves to avoid capture, taking out enemy soldiers if possible.
The bulk of Allied casualties would likely be American. The Soviets were attacking the lightest populated part of Japan, which the US/Commonwealth (the UK and former/current colonies) operation would be attacking the most densely populated part. The Allies were in the process of shifting troops from Europe when Japan surrendered, but the Commonwealth forces had hit the limits of their manpower. In the closing months of the war in Europe the British army was dissolving units to get replacements for other units, there were no more able bodied men available.
The US hadn't quite mobilized all the manpower they could tap. It was one of the few countries that didn't start drafting the oldest men available, but the US too was near max manpower. In 1945 they drafted most men who had gotten deferments to get advanced college degrees and put them in the infantry. There were cases of law school students getting put in infantry units as privates because they needed the bodies. My father knew one after the war who lost his deferment to go to law school and ended up on Okinawa.
The US minted 1 million purple hearts for the operation and the purple hearts given out today are from that batch. In the Vietnam War the bar for getting a purple heart was lowered and a number of soldiers got multiple medals for relatively light wounds. That was in part because they wanted to get rid of the huge stockpile.
Today we know far, far more about the long term effects from radiation than we knew in 1945. Some nuclear scientists were beginning to get an idea, but even the those working with radioactive material every day knew less about long term exposure risk than the average person of the public knows today. Those outside the nuclear industry knew very little, even people like the president of the US. It was known that a bomb site would be radioactive for a little while, but it was thought after a few weeks everything would be OK.
Casualty estimates for dropping the nuclear weapons was estimated to be about 100,000 immediately with maybe another 100,000 dying from radiation exposure in the following months. Nobody knew that the survivors would suffer from elevated cancer risk throughout their lives and many would die of cancer.
Truman weighed the loss of around 200,000 Japanese and a possible handful of Allied air crew vs the loss of over 1 million Allied troops and up to 10 million Japanese dead. Along with this he weighed the prospect of the USSR controlling half of Japan and the growing tension with the USSR. He also figured dropping the bombs on Japan would send a message to the USSR that the US had a new super weapon and was willing to use it, so be careful about getting too aggressive.
It's quite likely the cold war never turned into a hot war in large part because of the US bombing of Japan in August 1945. Through the cold war the leaders on both sides had first hand memories of the destruction of Hiroshima and Nagasaki. Many had been in the war and knew first hand a conventional war was terrible, but a nuclear war was unthinkable.
One of the problems we have today is there are almost no world leaders who remember World War II. Few even remember the post war nuclear tests. Those with good imaginations are fully aware of how destructive and dangerous these weapons are, but the less imaginative think a nuclear war is actually winnable and I find that thought terrifying because not only is it wrong, it's a mistake that could end life on Earth or at least set it back 100 million years!