For 70 years, India has struggled to remain a secular state. In spite of its people being overwhelmingly Hindu, it chose not to distinguish between its citizens — or putative citizens — on the basis of their religion. That principle was what its founding fathers fought for, and what for decades led it to proudly distinguish itself from Pakistan, born at the same time as India but explicitly as a homeland for Muslims.

The “two-nation theory” holds that the Muslims and Hindus of the subcontinent are always and forever two nations — the theory that Pakistan’s founders proposed and India’s founders rejected. But as far as the ruling Bharatiya Janata Party is concerned, India is knit together by its Hindu heritage. India’s Muslim citizens are at best to be uneasily tolerated, and at worst to be seen as interlopers who belong in Pakistan.

Last week, India’s parliament enshrined this worldview in law. It passed an amendment to India’s citizenship act that allowed a swift path to citizenship for refugees and migrants from certain neighboring countries — as long as they are Hindu, Sikh, Jain, Christian, Zoroastrian or Buddhist.

As with U.S. President Donald Trump’s “Muslim ban,” this law’s inability to hide its true intent is almost comic. Migrants fleeing religious persecution in the Muslim-majority countries of Pakistan, Bangladesh and Afghanistan are to be granted citizenship — but not those fleeing persecution in Buddhist-majority Sri Lanka or Myanmar. It is the latter, of course, where there’s a genuine humanitarian crisis — but the Rohingya are Muslim, so by the BJP’s logic they cannot and do not deserve a place in the Hindu homeland of India.

Hindus being murdered in Pakistan can flee to India — but not Shiites, Baloch or Ahmedis, who are if anything currently even more at risk in that troubled country. Once aspiring to be as multicultural, secular and inclusive as other modern liberal democracies, India now looks less to those countries as its model and more to Israel, Pakistan or China.

But it would be a mistake to think this new citizenship law is only about migration and refugees and nebulous notions of national identity. It is far more immediate and insidious than that, particularly when seen in combination with the other big state project in border areas: a national register of citizens, or NRC, which demands that residents produce extensive documentation, sometimes going back decades, to prove their Indian citizenship.

Naturally, this exercise is particularly difficult for some of India’s poorest, who have little or no paperwork. In the border state of Assam, millions were thrown into legal limbo when they were left off the NRC. But this, for the BJP, was a mixed blessing — because many of those whose citizenship might be revoked were Hindus.

The purpose of the Citizenship Amendment Bill is simple: when combined with the NRC, it can protect poor Hindus from the regulations that could render any poor Muslim a non-citizen at the stroke of an official’s pen. The purpose is to create, through law, a permanent threat to hang over every single Muslim head in India: Don’t stand up for yourself, or we will set you the impossible task of proving that you are, in fact, Indian.

Some people are puzzled that, in the midst of an economic slowdown that it has no idea how to combat, the government is instead spending enormous amounts of political capital on India’s variant of the Muslim ban. But for mainstream Hindu nationalism in India such a question is itself flawed. They see independent India’s seven decades of secular liberalism as a series of failures, with strong decision-making and the national will held back by attempts at inclusion and fairness. In their estimation, India’s many overlapping identities — language, caste, ethnicity and religion — are a drawback for development; they aspire instead to what they see as the admirable homogeneity of China.

For the Hindu nationalists, the task of nation-building is incomplete as long as there are multiple identities that can all claim to be Indian, and without a strong and unified nation, economic growth and development is impossible.

Yet it is secular liberal democracy that has kept the Indian experiment going when so many outside experts predicted during the country’s first decades that it couldn’t succeed. And, even today, it is inclusive liberal policy, both political and economic, that has the best chance of ensuring that it will be able to sustainably raise the living standards of all its citizens — while keeping them secure and defending their rights.

It’s not as if history’s lessons on this are equivocal. India’s Partition, in which one country turned to religious nationalism and one to secular liberalism, is the largest such natural experiment in history. One country, Pakistan, headed down the road to disaster; the other, India, has managed to make something of itself. Who would have thought that the one with a chance of success would decide at this late stage to emulate its less successful twin?

Mihir Sharma is a Bloomberg Opinion columnist and the author of “Restart: The Last Chance for the Indian Economy.”