Answer:
To take advantage of the area's wealth.
Step-by-step explanation:
Mahmud of Ghazni had already started his attacks and invasions on Indian lands when the power of the Rajput had declined.
He attacked Southern India to take control of the vast wealth there and the secondary reason he invaded was to spread Islam.