The US bombed both Hiroshima and Nagasaki because two types of bombs were involved and some in the military and government wanted a live test on human beings to see what, if any, difference the two bomb types produced. Neither bombing was necessary because Japan was ready and willing to surrender. Nor is the war in Afghanistan necessary because al-Qaeda is the enemy and the Taliban government of Afghanistan was willing to surrender bin Laden to a third country.
Trump launched 60 missiles against Syria only to prove his toughness. The damage done was minor and the airbase was functional within 24 hours. The use of the MOAB bomb in Afghanistan recently was probably unnecessary too. I strongly suspect that, like Hiroshima and Nagasaki, some in the military and government wanted to test it on human beings. It has not been used since in what are probably many similar situations.