I'm sure it's the literal truth.
Never know when you need to seismically image some hostiles for scientific verification of threat elimination.
Probably was both. NASA got a COTS component for their seismologic experiment, saving some time/budget on R&D, and military got to have a grenade launcher tested on the Moon, providing data for whatever "future warfare" programs they were surely running back then.
I think these days we call this "synergy"?
There were some quite insane wepon studies done for Project Horizon back in 1950s: https://en.wikipedia.org/wiki/Project_Horizon
IIRC the "claymore on a stick" option looked the best back then.