Answer. Mahmud of Ghazni attacked temples in the subcontinent because the temples were the seats of political power. The Brahaman priests kept all knowledge to themselves. They kept all knowledge away from the population, locked up in temples(including the knowledge to build the temple).