Explosions with that technology might not even be visible to earthlings,
nor be very destructive to the moon.
The fact that you used the word "might" there suggests strongly that there would be a wealth of scientific information gained by doing this. If you have to use words like "might", it means you really need to run some experiments, there's stuff you don't know yet...
The reason for doing it on the lunar surface rather than in space would be that you could set up testing equipment and instruments to get measurements you wouldn't be able to reliably position and read from later if you just detonated a nuke in orbit. The kind of stuff they had been doing in deserts or on atolls.
I can't imagine any benefit; scientific, military or political; can you?
Easily. Your failure of imagination is stunning here. I'm left wondering if you think we know a lot more than we do about this stuff (and thus would learn nothing from the experiment), or simply can't comprehend that greater knowledge is always better, even if the only thing you end up learning is "this doesn't really work well" (which is itself useful to know -- saves you from doing something useless in the future when it counts, and lets you know what sorts of things you don't have to worry about defending yourself from if you ever do have moonbases to defend or whatnot).
The amount of potentially practical information this could yield, especially in the minds of people who were seriously worried about the possibility that the Cold War was going to be extended throughout the Solar System someday, is huge. In retrospect, we certainly didn't need it, but how would they know that at the time?