The ruling was made by a seven-judge constitution bench headed by Chief Justice T. S. Thakur while hearing multiple petitions relating to electoral malpractices.
The petitions also included an appeal by BJP leader Abhiram Singh, whose election in 1990 to the Maharashtra Assembly was set aside by the Bombay High Court on the ground that he had appealed for votes on the basis of Hindu religion.
Welcoming the decision, Communist Party of India (CPI) leader D. Raja said the court has sent a strong message.
"It is a strong message but one would have to wait to find out if the RSS (Rashtriya Swayamsewak Sangh) and other Sangh Parivar outfits and various fundamentalist organisations would abide by this ruling," Raja told IANS.
Communist Party of India-Marxist leader Brinda Karat said raising issues of the scheduled castes and scheduled tribes should not be affected.
"It was important that the Supreme Court reiterated that elections are a secular exercise. So far as caste is concerned, we think it should not be equated with religion," Brinda told IANS.
Trinamool Congress MP Sukhendu Sekhar Roy insisted the ruling will not adversely affect the issues of the SCs and STs.
"We welcome the verdict that establishes elections to be a secular exercise. Our party believes that religion or caste or creed should not be subjects of politics," Roy, told IANS.
Congress spokesperson Priyanka Chaturvedi said the ruling was important in the wake of "religious and caste equations" dominating politics.
"Some parties have made religion and caste, part of their ideology to rise in Indian politics. This needed to be discouraged," she told IANS.
The Rashtriya Janata Dal said the current ruling will help in curing an anomaly created by an earlier verdict by the apex court.