Yes it was justified.
Some people here (and especially on the "no" side) are outrageously stupid and full of anti-American bias and needs to seriously brush up some real history and not some PC-crap they learned in public schools.
A lot of people forget that WWII isn't some Napoleonic Wars of the 1800s where it's just soldiers meet each other in the battlefield to settle the issue. With the introduction of an airplane thanks to the Wright Brothers in 1903, it took warfare to the whole new level.
In WWII, civilians in the cities were part of the war effort since all sides mobilized it's resources to defeat the enemy. Every bomb dropped, every bullet fired, every warships carry soldiers in the sea, every warplanes fly over other countries to strike targets, every tanks used to withstand bullets/shells, every uniform clothing made for soldiers, every artillery used to pound enemy troops, all were made by civilians. Obviously it's where the army used to get these things from and kill enemy soldiers overseas. Therefore, they were a fair game.
Bombing the cities full of military importance(also housed by civilians) would deny the enemy military the resources they needed to wage war against us. And as bad as it goes, it practically worked and Japan didn't have resources left by 1945 to wage war. This term is called "Total Warfare".
To give an analogy: If a person makes a bazooka gun, then gives it to a friend, knowing full well it was going to be used for a crime, then that person is so guilty. The civilians worked in the factories and small-time industrial workshops KNOW the weapons they were making was going to be used for war, therefore represents a fair game. It was either their life or ours. Every country values their life over the others so it's obvious both sides don't give a shit but only their own.
Hiroshima & Nagasaki were military targets. The HQ of the 2nd General Army under General Shunruku Hata was in Hiroshima which commanded the defense of all southern Japan and they were 40,000 soldiers stationed in the city. In Nagasaki, it also had thousands of industries supporting the war effort especially the Mitsubishi factories making "Zero" planes used to ran the U.S. naval fleet off the Pacific Coast. The idea was to cripple their war effort, not to kill as many Japanese, as historically illiterates used to say.
And the U.S. dropped leaflets on Hiroshima, Nagasaki, and 33 other Japanese cities on August 1st, 1945. Search "LeMay bombing Leaflet". It warned Japanese civilians that in a few days, the cities they lived in will be targeted for bombing and were advised to leave right away to save themselves from destruction. One of the leaflet statements also said, "bombs have no eyes", meaning they can't control where the bombs fell. Be it nuclear bombs, firebombs, high-conventional bombs, etc, it doesn't matter because what the warnings said on August 1st 1945 was serious.
Since most people in Hiroshima & Nagasaki did not leave, the deaths were their responsibility.
I don't see Japan doing that at Pearl Harbor nor American soldiers asked to be bombed that day. I also don't see the Japanese military doing that after conducting military operations in Asia that kill 20 million non-Japanese people as well.
And the Japanese didn't bother to surrender AFTER THE FIRST BOMBINGS. Many fanatic Japanese officers were convinced that the Americans only had ONE BOMB even they know it was. So they decided to go on with the war. However, the 2nd bomb was dropped on on Nagasaki and many Japanese officers still resisted to surrender. However, Hirohito feared that if they go on with the invasion, then the entire nation would be exterminated because the U.S. may have more A-bombs in the assembly lines. So they did,
And in response to the posting Anonymous that the invasion would only cost 100,000. Wow, you're a moron. The invasion of Japan would not just costs the U.S. 100,000 lives it also costs millions of Japanese lives too. There are rock solid basis for those estimates: Iwo Jima, Okinawa, Saipan. Those were outlaying islands of Japan. JAPANESE CIVILIANS committed suicide rather than surrender. In Okinawa alone, civilians including woman and kids were mobilized by the Japanese Army to fight the Americans and as a result, 100,000 civilians died. Do you really think it would have been easier on the mainland? No it was not. To say otherwise is really ridiculous.
The A-bombs saved more lives than it took. If the A-bombs was't used, then the U.S. would had go back to firebomb every major Japanese cities which would have caused the same amount of deaths ad destruction. Tokyo was ripped by firebomb and more than 100,000 civilians died in a single night which was worser than the A-bombs combined. Yes the radiation was a different story but in terms of deaths and destruction, i don't see the A-bombs different from the firebombings that was practiced by all nations during WWII.
Honestly, people needs to brush up their history like the "no" side is supposed to doing.