I've written admiringly before about Indonesia, that vast, sprawling country of over 17,000 islands and 240 million people where the national motto, "Unity in diversity", is no mere slogan to which politicians pay lip-service, but a living and celebrated sentiment.

Indonesia is the world's most populous Muslim state, with nearly 90 per cent of the population following the religion that first came to south-east Asia in the 13th century. But confessional freedom is guaranteed in the constitution. "All persons have the right to worship according to their own religion or belief," it declares. And as my report from Jakarta published in August concluded, even the Islamist parties that win small but significant shares of the vote are keen not to alienate the electorate by coming across as too militant. They will push locally for "Islamic" laws, yes (and the situation in Aceh is exceptional for too many reasons to go into here), but the country's pluralism is ingrained and the exercise of freedom much cherished after decades of dictatorship.

However, this liberty has one major omission. You cannot officially be an atheist in Indonesia. For the constitution also says that "the state shall be based upon belief in the one, supreme God" – although it deliberately doesn't specify which. Such vagueness may sound like the kind of fudge we in Britain, with our traditions of gradualism and compromise, should recognise. But this, too, is limited. Only six religions are recognised – Islam, Roman Catholicism, Protestantism, Buddhism, Hinduism and Confucianism. (Judaism, it may be noted, is not listed; but then, according to the World Jewish Congress estimate, there are only 25 Jewish people in Indonesia, and recent efforts to revive one community – including building what is thought to be the world's tallest menorah – have been welcomed and supported by local officials on the island of Sulawesi.)

All this has consequences: you have to declare your religion on your ID card, and atheism is not an option. In practical terms, most people will choose to enter the religion their families follow, however loosely (it is often not appreciated that, for many people, especially those in urban areas, religion is often much more a badge of cultural identity than a faith). It still means, however, that atheists are having to profess publicly to something they don't believe in. Their own belief, or lack of belief, cannot be officially acknowledged.

As these two reports detail, they have turned instead to the internet to form online communities where they can discuss and debate. One quotes Didi, a 29-year-old architect, as saying that it's the only way "to share my thoughts and to meet people who think the same way I do, because I don't see many in my real life. It's easier to say that you're gay than an atheist."

And there's more. The Hong Kong-based Asian Human Rights Commission put it thus in a report in February.

There is no provision for individuals with no religious belief to enter into a civil marriage contract, and no legal documentation for those without such a belief. This results in people keeping their atheist beliefs secret and when the time comes to marry, they make the choice of either marrying in a religious ceremony that is devoid of meaning for them, or not marrying at all, which can leave their family and offspring without legal protection. Moreover, under Indonesian Law No 23 of 2006 on Civic Administration, individuals are required to record their faith on legal documents such as identity cards and birth certificates. Atheists who ascribe to no religion or those who wish to leave the column blank or to register under one of the non-recognised religions face discrimination and harassment – including refusal of employment.

The commission concludes: "Forcing an Indonesian to adopt a religion as part of her identity grossly undermines his right to freedom of thought and religion under Article 18 of the International Covenant on Civil and Political Rights."

It may be, as the Malaysian opposition leader Anwar Ibrahim once put it, that "Homo religiosus" is the norm in much of Asia. It may be, too, that there are more pressing issues for the country to address, such as the phenomenal levels of corruption. But if Indonesia is to continue on the path of pluralism and become a new model for developing democracies – as many hope it will – it needs to draw on that spirit of generosity which is one of the country's most attractive qualities.

If people of faith desire members of other religions to respect their differing supernatural beliefs, it should surely not be too much of a leap to extend that courtesy to those who have none. It would be unrealistic to expect too much, and the United States, for instance, would be in no position to demand it when a declared atheist wouldn't stand a chance in running for America's highest office.

Allowing citizens merely to register their unbelief and protecting them from discrimination for having done so, however, would be a start – and not really a difficult one, if only there were politicians brave enough to point out that the fabric of the nation would not be torn apart by a few people saying thanks very much, but religion's not for them.