First, we have to understand that this is a subjective question. There is no objective way to determine what is or is not moral.
Second, in order to answer this, we must in some way define what we will say is moral. In this situation, I would say that the use of the bombs was moral if, on balance, they caused less suffering than would have happened had they not been used. Using this definition, I would argue that using the bombs was moral. However, there is no way to prove this.
If the bombs had not been used, the war would have continued. It is likely that the US would have had to invade Japan. The Soviet Union might have participated in the invasion. If these things had happened, there would have been at least two consequences. First, huge numbers of people, both Japanese and Allied, would have died. Many more people would surely have died in an invasion than were killed by the bombs. Second, if the Soviet Union had participated in the invasion, part of Japan would likely have become Soviet territory after the war just as part of Korea did. The people in that part of Japan would have been forced to live under Soviet rule.
Thus, it seems likely that more people would have died if the bombs had not been dropped. Additionally, some of the survivors would likely have lived under a brutal dictatorship as North Koreans do today. This seems to indicate that the use of the bombs was, on the whole, moral.