How the Apollo lunar modules were smashed for science

Each Apollo lunar module cost about $149,000,000. So why were they unceremoniously smashed into the Moon?