The Allies wanted to end the War fast and with the total surrender of the Japanese. Dropping the atomic bombs did this and I suspect also send a warning about US power - they could build another bomb. The aim of the firebombing had been to "soften" the Japanese for Allied invasion.
Officially, the following reasons were given:
Invasion would be difficult as due to geography, it would be easy for the Japanese to guess and defend likely invasion sites. The USA expected so many casualties from the planned invasion of Japan that they manufactured 500,000 Purple Hearts - they still have not given all of these out and apparently in Iraq and Afghanistan the US forces were able to keep a supply on hand to immediately award to injured soldiers.
The predicted cost in civilian lives of an invasion was in the millions - there was a famine in Vietnam which was killing tens of thousands a month for every month the War went on in the surrounding countries. Cities in Southern Honshu had been separated from the found producing areas of Japan and 10 million were at risk of starvation.