@Leon Said
To end the war. Japan's philosophy was similar to most Asian countries regarding war, and that is to fight without surrender.
Civilian casualties were an accepted part of war back then.
It was a tactic which may have had some political / military legitimacy at that time..... Show the world you have this weapon, demonstrate that you are not afraid to use it, and then promise to stop using it if the enemy sues for peace.
Carrot and stick.
There is little doubt that whatever country developed nuclear weapons first (and Nazi Germany was very close) they would use it. In that regard it isn't surprising that the US did so.
Of course, that was the short term view of the day. What followed next was inevitable. The Soviets HAD to have this weapon. They knew the Germans were close to producing a nuclear weapon and as they advanced westwards they took as many German scientists as they could. America did the same thing, only they concentrated on taking rocketry and heavy lifting specialists, which came in very handy when it came to winning "The Space Race"... but that's a different subject. Let's stay on topic, here.
The arms race following the surrender of Japan in the face of nuclear attack sent out a message to other countries that they too must have these weapons. Britain, France and China soon acquired them. Others have done so since.
The philosophy of Mutually Assured Destruction (MAD. No more appropriate acronym has ever existed) is alleged to have prevented superpower conflict between the West and the Soviet Union during the Cold War. That is a debatable issue in my opinion. However, it is a fact that no
tactical nuclear weapon has been used since 1945 (although lesser grade weapons are believed to have been used, such as depleted uranium shells deployed by US forces attacking Fallujah, Iraq, which are believed to have caused horrible birth defects since. See this link:
https://www.guardian.co.uk/world/2010/dec/30/faulluja-birth-defects-iraq )
Now we live in a world where the west lives in fear that countries such as Iran will soon possess a nuclear capabilty which they may be prepared to use against America, Israel or any other nations, regardless of the threat of retaliation.
The prospect of nuclear proliferation should be worrisome to us all. These weapons in the hands of extremist regimes would be a serious threat to security, but the counter argument that, if one country has them and is prepared to use them, then should not others also possess them as a deterrent..?
Whether or not these countries would truly keep nuclear weapons as a deterrent only, I do not know. To be honest, I doubt it. It's reasonable to say we should not trust them. On the other hand, how trustworthy are we...? In their eyes, it is we who are the present wielders of weapons of mass destruction and if the allegations about Fallujah are true (and bearing in mind the USA's recent record, who can trust America to tell the truth..?) then the scope for escalation is apparent.
Nuclear weapons cannot be "uninvented" and it is probable that the current nuclear powers will never give them up (although I think they should).
If proliferation is to be avoided, those who have these weapons must act in a manner that makes it clear to the world that no threat is presented to anybody else.... that other countries do not need to have such weapons themselves. This must be backed up by an efficient, effective means of checks and controls by the UN. This is the only way in which proliferation.... and the inevitable, eventual consequences of loss of control over these weapons.... can be contained.
Nuclear weapons must be contained, and that process of containment starts with those countries that already have them.