Now, over 70 years later, there are indications that Nehru's hopes for the nation are facing perhaps their greatest threat.
The Hindus consider the place to be the birthplace of Lord Ram, one of the most revered deities in Hinduism. However, Muslims have also been praying there for centuries.
The decision on the Ayodhya site is seen as a blow to Muslims. It came at a time when Muslims were increasingly perceived as second-class citizens in a predominantly Hindu country.
The Modi Bharatiya Janata Party (BJP) has its roots in the Rashtriya Swayamsevak Sangh (RSS), a right-wing organization established in 1925 that promotes the vision of a Hindu nation.
Although Hindu nationalism has been known by Modi for decades, it has been around for decades.
When India gained independence from Britain in 1947, Nehru, the architect of contemporary India, helped to establish a constitution that protected "freedom of thought, expression, faith, religion and worship" – and "equality of status".
"Nehru was very aware of the fact that India is a diverse society and the only thing that can work is secularism," Sanjay Kapoor, a political commentator and editor of the independent political magazine Hardnews, told CNN.
In the coming years, the concept of secularism became more abstract. Political parties – including the Indian National Congress (INC) own party – Nehru began giving out to voters during religious differences.
The issue with Ayodhya first helped the BJP gain considerable electoral weight.
The controversial religious site is an old issue of controversy that has only ever received local attention, but the BJP has used it to secure more than half the seats in the 1991 Uttar Pradesh state elections.
The Rise of Nationalism
At that time political observers bviniha BJP in inflaming religious divisions and empowerment of Hindu nationalists. These criticisms are still leveled at Modi's party today.
In 1992, just one year after the BJP election victory, right-wing Hindu mafia demolished a 16th-century Babri mosque in Ayodh, causing national unrest that left more than 2,000 dead. It was one of the worst communal violence since India's independence.
For some, it was a moment that changed Indian politics. Kapoor, the editor, remembers how some of his fellow journalists saw the destruction of the mosque and the ensuing riots as the end of secular India.
After the murder of corruption scandals in the 2000s, INC lost support, opening the BJP's gates to power.
In 2014, Modi and the BJP crept to victory in national polls, becoming the first party to win a parliamentary majority in 30 years. It was a move toward nationalism, even before right-wing politics took place in the United Kingdom with Brexit and Donald Trump's "First America" campaign in the United States.
For those who are tired of what they consider to be cronyism and political dynasties, Modi's promise of economic reform in restoring traditional Indian values is promising.
But India's new leader also promotes religious nationalism.
In Modi's first term in office, Hindu vigilante groups killed dozens – many Muslims – who were said to have slaughtered or transported cows, considered sacred by many Hindus. Critics said the presence of a Hindu nationalist government in Delhi encouraged hard-line supporters to commit violent acts against Muslims and other minority groups. An accusation the BJP flatly denied.
A bleak future
When Modi came to power, he had three key promises to choose from. It would abolish the autonomous status of Jammu and Kashmir, build a temple for the Hindu god Ram in Ayodhia and impose a unified civil code that would create a law for everyone, regardless of their religion.
having been re-elected in his second term, Modi has already set out to achieve two of his goals.
In August, he withdrew Article 370, a constitutional provision that gives Jammu and Kashmir relative autonomy and protects employment rights, property ownership and state aid for its permanent residents. The government also called for interruption of communication in the area.
People in Jammu and Kashmir – who are reduced to Union territory – fear that Modi's move will encourage migration to the predominantly Muslim area, which may change its demographic characteristics.
The Supreme Court's decision that the Aries Temple could be built in Ayodhya also provoked a reaction from Muslim communities.