There were many factors that went into the decision to drop the bombs, but the main reason was to end the war quickly (again for several reasons). Sure, the Japanese were essentially defeated already and many of them wanted to surrender, but all indications were that the emperor was unwilling to surrender and that they would fight until the last man. The projected casualties for the planned invasion of the Japanese mainland were around 1.5 million when counting both Japanese and Allied forces (which is more than what the bombs killed, even including the lasting effects), so it may have actually ended up saving lives. However, the primary motivation for using the bombs was to get Japan to surrender before the Russians got involved, because Truman didn't want to have to split up Japan like what happened to Germany after the war.
In retrospect (as was also pointed out by others below), it was also the right decision because it showed the world what the weapons were actually capable of, and how horrible they are (a science experiment as you called it), which has resulted in us not using them again since. Had that not happened, we likely would have used them in the next major conflict and made things much worse. There had been people pushing to drop the first bomb on an uninhabited island near Japan as a demonstration, but that likely wouldn't have had quite the same effect.