In fact, President Truman had indicated to the War Department that he wanted "no women and children" harmed in the bombing of Hiroshima. It is true that President Truman was faced with the choice of using the Bomb or invading the Japanese mainland. It is also true that an ultimatum had been issued to the Japanese government. What the above answer does not state is that the Japanese government had already met and discussed terms of surrender which in essence asked that the Emperor be preserved. For reasons highly debated by Historians, Japanese overtures of surrender were ignored under the highly unlikely argument that the Japanese were bluffing.
The Peace Memorial Museum at Hiroshima, which I have been privileged to visit, indicates the Japanese position that the Bomb was used primarily to end the war quickly before the Soviet Union had an opportunity to gain a foothold in Asia. Another frequent argument is that the U.S. wished to demonstrate to the Soviets that they did in fact have the bomb; presumably a deterrent to future Soviet aggression.
There is no evidence that the attack was deliberately intended to bring about civilian casualties. The civilians were sadly a necessary consequence of war.
The Japanese had made peace overtures, which was why I said that the Japanese would not accept unconditional surrender. That is an important point that certainly should have been more clearly stated, even if it is not germane to the question of why the Americans were willing to target civilians with the attacks.
As for the statement by Truman that he wanted the targets to be chosen so as to avoid casualties among women and children, he knew perfectly well once those targets were actually chosen that they were not primarily military installations. Considering the firebombing of other Japanese cities in the months leading up to the attacks on Hiroshima, it is difficult to argue that preserving civilian lives was a major concern of his. Inflicting terrible destruction was.
The Hiroshima and Nagasaki bombings actually came at the end of an extensive bombing campaign of major Japanese cities that cost hundreds of thousands of civilian lives. About 10 percent of the population (close to 100,000) people were estimated to have died in fire-bombing attacks deliberately planned to bring about massive amounts of civilian causalties. Similar attacks had taken place in Germany, including the famous firebombing raids on Dresden. Attacks that led to enormous loss of life among civilian populations were thus viewed as justifiable by the Allies in this new type of total warfare. Even after the frightful losses suffered in the earlier bombing raids, the Japanese government refused to accept the American demand for unconditional surrender.
Faced with the prospect of a frightfully bloody invasion of Japan, and, many have argued, eager to impress the Soviet Union with the terrifying new weapon the US had at its disposal, President Harry Truman ordered the bombing of these cities, hoping the enormous loss of life would persuade the Japanese to surrender and bring the war to an end. The loss of life among the civilian population was profound, but many historians have argued that more civilians may have died in an invasion. This does not appear to have been part of Truman's thinking, however. Aside from any geopolitical concerns, which were almost certainly present, he seems to have been primarily interested in limiting American casualties.