By the time the atomic bomb was dropped on Hiroshima, the decision to use it had been settled (at least in Truman's mind) for some months -- contingent on the first successful tests of the weapon. The United States began top-secret work on the bomb in 1942, believing that the Germany and Japan were working toward the same goal and not knowing how close either country was to development of an atomic weapon. Truman believed that the United States had to pursue atomic capabilities to address this threat.
The Manhattan Project, the name for the atomic bomb development project, actually started as a research effort in 1939, when it was feared that the Nazis might be first to archive nuclear capability. The project eventually employed more than 130,000 people and cost nearly $2 billion. Many historians believe that the enormous scope, time, and expense of the project figured into the final decision to use the atomic bomb on the Japanese. Since such an investment had been made in the weapon, why would we not use it?
In 1945 many of Truman's military advisers were against using the bomb, believing that Japan was close to surrender and that using atomic weapons was a case of overkill. Truman believed intelligence reports that informed him that the Japanese still maintained hundreds of thousands of troops who would resist a land invasion of Japan to the bitter end. He believed that the dropping of the bomb would not only bring a more expedient end to the war, saving thousands of American lives, but might even result in fewer Japanese causalities in the long run.
The administration also believed that the display of America's willingness to use atomic weapons would serve as a deterrent to the Soviet Union who was in the process of nuclear development. Truman feared that the possession of atomic weapons by the Communists might lead to a volatile situation following the war and that, by being first to actually use the A-bomb, the U.S. might instill some caution in the mind of Stalin.
The dropping of the bomb may have accelerated the arms race, but most historians believe the race began with the development of the atomic bomb and that acquisition of nuclear capability by the Soviets and the long Cold War were an inevitability after that.
Hope this helps!