There are several important reasons. First, Japan had rebuffed all talks of surrender of any kind. They had turned down the proposed Potsdam Declaration, taking the stance of mokusatsu, "to kill by silence." It appeared that the Japanese would defend their islands to the last man, as they had previously at Okinawa and Iwo Jima. Secondly, Allied estimates concerning an invasion of the islands calculated that losses would probably be at about one million killed, wounded and/or captured. The Allied command decided that dropping the bombs would save hundreds of thousands of American, English and other Allied forces' lives. They also figured that the atomic bombs would show Japan the depth of the Allies' new power and force a surrender.
It was a quick decision on his part as the first successful atomic bomb test took place on July 16, 1945, and the first actual use of the bomb was against Hiroshima on August 6, a mere three weeks later. There was not much debate in the US government about whether or not the bomb would be used against Japan.
Over the previous two years, the US had been invading Japanese held territory island by island, and, under the Code of Bushido, Japanese soldiers refused to surrender. This led to bloody, long battles with US forces, and Truman felt the Japanese army and population would fight even harder on the Japanese home islands. So some say he decided to drop the bomb to save American lives, which would have been lost in the invasion, and Japanese lives as well.
There is a school of thought that also suggests Truman wanted to scare the Soviet Union. The Cold War was more or less already underway by this time, and Truman had hinted at the existence of an atomic bomb program when he met with Stalin at Potsdam in 1945. So some argue he dropped the bomb in order to discourage the Soviets from taking more territory after the war. All it did was lead to an arms race where the USSR developed its own bomb program within four years.
Perhaps one of the reasons that motivated the Americans to drop the atomic bombs on Japan was the fact that by using the bombs, the US could seek to control the circumstances of post-war Japan and to impose American control in the redesigning of Asia. The sheer costs and effort spent on developing the nuclear warhead during the Manhattan Project also meant that the concentration of cutting-edge scientists and engineers employed were generating a momentum that could not be stopped - they wanted to see the atomic bombs in use and Japan provided the best opportunity, at that time, to do so. Casualties were also a key factor. Truman had been informed by his military advisers that it was necessary to invade the Japanese mainland since the imperial army would fight on a suicidal scale to counter the American troops. Due to such a tenacity in fighting, a high casualty count was to be expected from the American forces. This estimation greatly influenced Truman in his decision-making, since the operationally-ready nuclear weapons could be used to force Japan to surrender without an invasion of the mainland and the incursion of high casualty numbers - they could be used to preserve American life.