Hiroshima also had one very large military target:
The Mitsubishi factories, the USA definitely wanted to take those out.
Nagasaki was a " miss" apparently, because of the weather, they wanted to hit a far larger area.
@ Catrilia, you forget the people that were born with radiation illnesses and mutations throughout the years, those aren't in the numbers. But yes the USA wanted to prevent a full scale invasion, because they feared Japan would fight till the last man standing.
Further more it was the psychological effect, showing Japan that the USA had no problem at all, killing citizens of Japan, they have also shown this by bombing Tokyo with Napalm before the bombs.