I’m studying medical imagery so I have a good basis or radiation knowledge but I’m still only 1 semester in so take it with some salt ..
so for the two nuclear bombs that were used against people the goal was maximum immediate destruction. The reason to detonate in the air is partly for more destruction as others pointed out but also because it gives more potential that the radioactive material is used as fuel for the explosion. The goal is not radioactive fallout. If an atom bomb would explode in the ground more of the radioactive material would be absorbed into the ground and slowly disintegrate, causing long term radiation (depending on the type of radioactive material, it’s half-life, disintegration processes and thus type of radiation etc.)
Atom bombs basically are “interesting” to use because for much smaller mass of fuel you can get a lot more energy to use as destructive power due to the radioactive chain reaction of the bomb, not because it’s radioactive specifically.
Latest Answers