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.
Never know when you need to seismically image some hostiles for scientific verification of threat elimination.
I think these days we call this "synergy"?
IIRC the "claymore on a stick" option looked the best back then.