There seems to be some misunderstandings at work.
When Alauddin Khalji's conquest of Gujarat took place:
In early 1299, Alauddin sent Ulugh Khan and Nusrat Khan to invade Gujarat, where the Vaghela king Karna offered a weak resistance. Alauddin's army plundered several towns including Somnath, where it desecrated the famous Hindu temple.
As it is a ...
A search on Google Books turns up the following on p. 31 in this book, The Rajputs of Saurashtra by Virbhadra Singhji.
In A.D. 1024 Mahmud of Gazni sacked the Somnath temple. Subsequently in A.D. 1297 Alafkhan, a General of Ala-ud-din Khilji sacked Somnath temple again and appointed a Muslim Governor to rule from Junagadh.