A critical part of developing any weapon of war is to analyze how effective it is at destroying the enemy's ability to fight. This result can be gained from many different angles, one such being a psychological attack to cripple morale and long-term war commitment.
When the United States developed the atomic bomb, they were limited in their options for analyzing its full magnitude. Secluded tests like those at Los Alamos did not go unnoticed by locals, and the longer the weapon was concealed, the more likely it was to have a security breach that may impend the United States from using it when and where they wished to bring about the end of the War. This is seen by the locals who inquired after the first nuclear test at Trinity and were told a fake story about an accident at a munitions depot.
Blowback from Truman's announcement shows that had the United States revealed the Manhattan Project before 1945, it may encountered resistance from the public. The United States fully realized that the Japanese mindset at the time would not consider surrender even if she had no allies in the world -- that a full-scale invasion would be necessary to end WWII.
But if this mindset could be broken by a weapon unlike anything ever seen, the traditional thoughts concerning fighting to the death may be changed, and many lives on both sides could be spared.
And yet the U.S. still had limited information on exactly how big of an explosion Little Boy was capable of. This is the reason for the selection of Hiroshima and, later, Nagasaki. These two cities, as stated in the above answer, had been relatively untouched by the ravages of war, but they also had a concentration of military supplies and troops that would serve as a strategic target. The shape of Hiroshima was geometrically ideal for deploying the bomb as well because from the air, damage could be easily assessed.
The aftermath of the two major bombings supplied researchers with accurate effects of using such weapons, and these ghoulish results were then used to refine and build better weapons that could be used in future situations.
But aside from science, the bombing of Hiroshima was a blow to the Imperial Japanese morale which was not easily bent. After Japan saw not only that we were willing to fight with nuclear technology but that we also had more weapons to use (as was the purpose of the second bombing,) it became clear that WWII was not a engagement that Japan was able to continue at that time. At this point the reality of the situation was literally "surrender or genocide," and no nationalism could replace basic want to survive.
In short, Hiroshima showed the true nature of the Atomic weapon to the world, including both combatants in the Pacific.