There were three reasons why dropping the bomb against Japan was not a military necessity: Soviet involvement in the war, American air superiority, and Japan's lack of air and naval forces by mid-1945.
After the defeat of Germany in May 1945, the Soviet Union attacked Japan three months later. Joseph Stalin had promised to make this assault, and he kept his word. Soviet troops, fresh from their victory over Nazis, were a formidable adversary. The Soviet Union and Japan had already clashed in 1939, and the Soviets had won those engagements. By August 1945, the Red Army was at its peak. The Japanese Army in Manchuria, on the other hand, was not in top form because most of its best units and equipment had been redeployed to the Pacific to face the Americans. The Soviet attack made the Japanese position in Asia untenable. Those Soviet troops could also have been used in an invasion of Japan.
American air superiority was another reason why the use of atomic weapons was not necessary. Japan came within range of American bombers by mid-1944. In March 1945, Tokyo was devastated in an American bombing raid. American air assaults were conducted with impunity, and they were often as lethal as the nuclear weapons would be.
Finally, Japanese naval and air forces had been annihilated. In April 1945, the Yamato, perhaps the world's finest battleship, was sunk by American planes. By mid-1945, the Japanese lacked planes, and most of their trained pilots were already dead.