My mother was not happy with David Cameron over gay marriage. She collected signatures to petition against it. An Irish Catholic born in postwar Cork who came to work as a nurse in England (where she later met my dad, a Gujarati Hindu doctor), she has views typical for her faith and generation.

She wasn’t that surprised that her children didn’t want to sign the petition, however, or that the Prime Minister’s opponents lost the argument in Britain. Attitudes were changing fast back in Ireland too. Even rural Cork voted heavily for gay marriage in the Irish Republic last Spring, a remarkable sign of how much the Catholic Church’s socially conservative influence has diminished.

The ICM poll for a new Channel 4 documentary, What British Muslims Really Think, finds that 52 per cent of British Muslims would prefer homosexuality to be illegal. This seems outrageous. As Theresa May, the Home Secretary, insists, respect for gay rights now sits alongside respect for free speech and democracy as a British value.

But while tolerance like this is a welcome development, it is also a recent one. As recently as 1999, British Social Attitudes evidence found that 49 per cent of British people thought that homosexual relationships were always or mostly wrong. Seven out of 10 Anglicans and Catholics thought so in the 1990s. Only a third do so today. Many people of faith changed their minds. This is now happening, more gradually, in black and Asian communities too, where coming out to friends and family remained taboo for longer than in the wider population.

In the debate about the isolation or otherwise British Muslims, as accusations fly that there is an Islamic “state within a state”, it is important to get right what our common citizenship demands. A liberal society should not police freedom of thought or freedom of expression, nor insist that citizens sign up to every aspect of a secular worldview.

What we do need agreement on is the equal status of our fellow citizens. People can hold religiously conservative views – like my mother – but they must accept the equal status of their fellow Britons. Indeed, what matters most in “British values”, is accepting the freedom of speech of those we disagree with.

The Channel 4 poll presents a mixed picture of integration. People will be worried that almost a quarter of those surveyed would like to see Sharia law implemented. Clearly, that isn’t going to happen – the rule of law depends fundamentally on one law for all. And put another way, more than three-quarters of British Mulsims don’t want sharia.

Trevor Phillips, who hosts the new documentary, warns that it is “patronising” to assume that Muslim immigrants will become “like us”: that the British story of integration will be replicated with the British Muslim community just because the Irish, the Jews, the Sikhs and the Hindus made it. He’s right that nothing is preordained, in either direction. Complacency is not an option. But suggesting there is a “growing chasm” across the generations is too pessimistic.

Most of Britain’s three million Muslims are under 25. The majority who are British-born and went to school here are not going to keep the same approach to gender relations that their grandparents and parents have. There are many British Muslim women, for example, who challenge self-styled community leaders who try to block their full involvement in local politics. We should support them.

Of course, these feel like tough times for those of us who are confident that we can and must make integration work. The poisonous influence of the so-called “Islamic State” depends on trying to capture young minds with the message that Muslims can never be at home in the West – that a clash of civilisations is inevitable. Yet there is good news that rubbishes this outlook. Britain’s most diverse schools are getting the strongest results, with young women from Pakistani and Bangladeshi backgrounds making the fastest progress. Where there is evidence of growing segregation in local school intakes, or of reduced contact between groups, we should not be relaxed about it, or stand idly by.

Instead, we should be absolutely clear about what a fair deal means for immigration and integration; what it requires from both immigrant and the people of that immigrant's new home country. The deal has three elements: that those who come here speak English and accept the rule of law; that we recognise incomers and their children as equally British; that we promote contact between those from different backgrounds.

While tonight’s documentary poses a fundamental question, “Are Muslims different?”, the poll findings suggest young people in this country see no conflict between being British and Muslim. Dilwar Hussain, Director of New Horizons in British Islam and convenor of last month’s British Islam conference, tells me: “There is too strong a sense of ‘them and us’ on both sides. That will change when people see how this generation is cultivating a strong, confident, home-grown British Islam, rooted here. This will break down the stereotype that Islam is only authentic when imported from Saudi Arabia or Pakistan."

That should be the effort we could all get behind. Tonight’s documentary raises some important questions – but it could have more confidence in our ability to find the answers.

Sunder Katwala is the director of British Future, a think tank focused on identity and integration