The US was justified in using the atomic bombs against Japan. Using the bombs saved tremendous numbers of American lives. In addition, while the US may not have actually considered this at the time, the atomic bombs surely saved many more Japanese lives than they took.
When a country is at war, its first responsibility is to win the war while taking the fewest possible casualties. Of course, there are some rules about how the enemy must be treated, but the atomic bombs did not break these rules. While we treat the atomic bomb as if it were somehow much different and much worse than conventional weapons, it is not clear that it really was. For example, the Americans firebombed Tokyo on one night in 1945 and killed more Japanese than were killed immediately by either atomic bomb (but not more than both combined). It is hard to see how the atomic bomb was much worse than this sort of bombing.
In addition, the atomic bombs were surely better than what would have happened if the US had invaded the home islands. It is estimated that as many as 100,000 or more civilians died in the American invasion. If that many Japanese could be killed in the invasion of a small island, how many more would have been killed in an invasion of all of the main islands of Japan?
When we look at it like this, the decision to drop the bombs is justifiable. What the bombs did was horrible. What would have happened to American military personnel, Japanese military personnel, and Japanese civilians in an invasion of Japan would have been worse.