The Congress accused the BJP of hatching a conspiracy against its leader and insisted Gandhi has declared himself as a 'Shiv Bhakt' (Lord Shiva devotee) and is a 'janeu-dhari' (sacred thread-wearing) Hindu.
The BJP, however, dismissed the conspiracy charge as baseless, saying Gandhi's aide who signed the register belongs to the Congress.
The temple administration said Gandhi's name was written in the shrine's register for non-Hindus by his media coordinator and maintained none of its staff was involved in the entire episode.
Non-Hindus are allowed to visit the temple but have to first get themselves registered at the shrine's office.
Gandhi, on campaign trail for the December Assembly polls, began his two-day visit to Gujarat after offering prayers at the famous temple in Gir-Somnath district. The temple, devoted to Lord Shiva, is around 400km from here.
A purported photocopy of the page of the register for non-Hindus with names of Gandhi and senior Congress leader Ahmed Patel written on it went viral on social media soon after their visit to the shrine this afternoon.
The signature against their names was that of the Congress party's media coordinator Manoj Tyagi.
"This is fake. Tyagi was made to sign on a blank paper of the register for media entry and later the names of Rahul Gandhi and others were added in the register," said Congress spokesperson Randeep Surjewala.
"This is a conspiracy of the BJP. Prime Minister Narendra Modi is a trustee of the temple trust," he said.
Surjewala insisted Gandhi only signed the visitor's register where he wrote that the place was "inspiring".
The Congress spokesperson said Gandhi, during his recent trips to Gujarat, declared he was a devotee of Lord Shiva.
"You may want to know which religion Rahul Gandhi follows? I would like to tell you that he is a janeu-dhari Hindu," said Surjewala.
The BJP, however, demanded that Gandhi declare his religious faith before people.
"He should make his faith clear to the people of this country after the controversy?" BJP spokesperson Raju Dhruv said.
BJP national spokesman Sambit Patra rejected as "baseless" the Congress' conspiracy charge, saying Manoj Tyagi was a Congressman.
"Rahul, in his affidavit to the Election Commission, has shown different things and in the Somnath temple he is showing different things. He should come clean," Patra said.
"Rahul may belong to any religion, we do not have any problem. We respect him. But the people of the country will get confused with this controversy," Patra said.
As the controversy raged, the temple management came out with a clarification.
"As per our rules, names of non-Hindus have to be registered. His (Gandhi's) name was registered by his media coordinator in our non-Hindu register.
"I would like to say that no staff member of our trust was involved in what the media coordinator did," managing trustee of Somnath Temple Trust PK Lehri said.
Lehri also said in the visitor's book, Gandhi wrote that the Somnath temple is an "inspiring" place.
The Congress leader has visited more than 15 temples during his multiple visits to poll-bound Gujarat in the last two months.