Pearl Harbor was surely a factor in dropping the bomb, but I believe the projected 1 million US casualties and up to 30 million Japanese casualties if we had invaded Japan had much more to do with it. That and sending a message to the Russians. Dropping the bomb saved a vast amount of American and Japanese lives and prevented Japan from seeing the division that Germany and Korea did.
"Do not forget your dogs of war, your big guns, which are the most-to-be respected arguments of the rights of kings."
- Frederick the Great, King of Prussia