Better question is whether the second bomb was necessary or more of a show of power/ warning to Russia.
iirc Japan had already rejected US terms for surrender. One bomb wasn't sufficient to get Japan to surrender under US terms.
Every day that passed the element of surprise and effectiveness of the bomb was waning. Wait too long and there was no certainty Japanese air defense could not have been organized to make the bomb risky to use. (Same reason I have heard the reason dropping in the ocean was ruled out--the small chance it wouldn't detonate and come into Japanese possession was an unacceptable risk.)
War sucks. The losses in Japan due to the bombs are horrific. Thinking of the children lost is, if you think about it, is beyond my ability to grasp that level of pain, suffering, and loss. Children. The entire lives ahead of them. Vaporized in an instant -- if lucky.
But this wasn't an isolated event. There was Pearl Harbor. And all the horrible things Japan did on the mainland and how they fought in general. Generals see it pretty simple:
1,000,000 of my people or 100,000 of theirs.
Easy choice (for the generals). Horrible options for humanity.