When war is inevitable, killing soldiers is a sad consequence of it, but the nuclear bombs in Japan killed hundreds of thousands of innocent people, including women and children. It was an act of complete inhumanity, and therefore, not justified.
Japan was already a beat down nation before the Hiroshima and Nagasaki bombs were dropped in their territory, but it is possible that, without the nuclear bombs, they would have kept fighting and the war would have lasted many more months, killing perhaps hundreds of thousands, if not millions of lives on both sides.