The wave of compassion that met last week’s assault on Charlie Hebdo didn’t last long. Soon afterwards, all sorts of criticism started pouring down the web against the magazine, which was described as Islamophobic, racist and even sexist. Countless other comments stated that Muslims were being ostracised and finger-pointed. In the background lurked a view of France founded upon the “myth” of laïcité, defined as the strict restriction of religion to the private sphere, but rampantly Islamophobic. As a Frenchman and a radical left militant living in the UK, I was puzzled and even shocked by these comments and would therefore like to give you a clear exposition of what my leftwing French position is on these matters.

Firstly, a few words on Charlie Hebdo, which was often “analysed” in the British press on the sole basis of a few selected cartoons. It might be worth knowing that the main target of Charlie Hebdo was the Front National and the Le Pen family. Next came crooks of all sorts, including bosses and politicians (incidentally, one of the victims of the shooting was an economist who ran a weekly column on the disasters caused by austerity policies in Greece).

Charlie Hebdo was an opponent of all forms of organised religions, in the old-school anarchist sense: Ni Dieu, ni maître! It ridiculed the pope, orthodox Jews and Muslims in equal measure and with the same biting tone. It took ferocious stances against the bombings of Gaza. Charlie Hebdo also continuously denounced the pledge of minorities and campaigned relentlessly for all illegal immigrants to be given permanent right of stay. Even if you dislike its humour, please take my word for it: it fell well within the French tradition of satire – and after all was only intended for a French audience. I hope this helps you understand that if you belong to the radical left, you have lost precious friends and allies.

This being clear, the attack becomes all the more tragic and absurd: two young French Muslims of Arab descent have not assaulted the numerous extreme rightwing newspapers that exist in France (Minute, Valeurs Actuelles) who ceaselessly attack Arabs, Muslims and fundamentalists, but the very newspaper that did the most to fight racism. And to me, the one question that this specific event raises is: how could these youths ever come to this level of confusion and madness? What feeds into fundamentalist fury?

A friend told me it was “the west bombing Muslim countries”. I am suspicious of a statement that reads like an inversion of Samuel Huntington’s theory of the “clash of civilisations”: the western world v the Muslim world. Neither the west nor the east are homogeneous blocks, and the first step towards understanding fundamentalism is to recognise that the place of Islam is contested in the east, just as that of Christianity in the west.

Facebook Twitter Pinterest Algiers after independence in July 1962. ‘Violence often led Algerians to migrate to France; to this day, they loathe the fundamentalists who robbed them of their secular state.’ Photograph: Gamma/Gamma-Keystone via Getty Images

Anywhere in the world, the space for individual rights has always had to be opened by rolling back religion a few miles. Few people even know today that there was a period, beginning in the mid-19th century until the mid-20th century, called the Nadha (Rebirth, or Renaissance), which saw a wide-ranging process of secularisation from Morocco to Turkey. Few people care to remember that in the 1950s and 60s, women wearing the veil were a small minority in Tunis, Algiers and even Cairo. This does not mean they were not Muslims, mind you. Just as in the west, where a lot of Christian girls started having sex before marriage or taking the pill, principles were evolving, with some inevitable tensions.

Anti-colonial movements in France’s former empire were secular: they intended to create modern nation-states independent from the tutelage of western exploiters. Thus in Algeria, the Front de Libération Nationale was fighting for the creation of a Democratic And Popular State of Algeria (note the distinctly communist touch). Yet the chaos that emerged during and after independence wars (for which the west clearly has responsibility) provided an excellent opportunity for fanatics who had deeply resented the evolution of their countries, to return to prominence with a vengeance.

Their violence often led Algerians to migrate to France; to this day, they loathe the fundamentalists who robbed them of their secular state.

Let us be clear: fundamentalism is not caused by immigration from Muslim countries. Muslims migrated to France as early as the 1950s and the issue of fundamentalism has only arisen in the past 15 years. France has a long tradition of secular Islam, fully compatible with the laws of the republic, but at war with fundamentalists. In the 1990s, the Paris imam was shot by fanatics whose violence he denounced; more recently, the imam of Drancy, who expressed displeasure with Charlie Hebdo’s cartoons but firmly denounced the fatwa issued against it by al-Qaida, was himself condemned to death by the terrorist organisation and is living under police protection.

Fundamentalism is something new, that exercises a fascination on disenfranchised French youth in general – not on Muslims in general. The older generation of French Muslims is terrified by the rise of fundamentalism: after the shooting at Charlie Hebdo, imams demanded that the government take action against websites and networks propagating it.

So how did it penetrate French society? I think the answer has less to do with the west bombing Muslim countries than with the utter failure of the French republic to be true to its principles of Liberté, Egalité, Fraternité, which are the necessary foundation of laïcité.

I often read in the English press, or hear from British friends, that French laïcité is a “foundational myth” – as if France lived under the illusion that religion could be eradicated once and for all. This has nothing to do with laïcité properly defined. Laïcité does not deny anybody the right to express their religious beliefs, but it aims to found society on a political contract that transcends religious beliefs which, as a result, become mere private affairs. The vast majority of French Arabs are profoundly, even fiercely laïc. The beurs who marched on Paris in 1983 were not making religious claims but demanding equal rights as citizens. If only these rights had been honoured.

In a beautiful book titled La Démocratie de l’Abstention, two sociologists show that French citizens who arrived from the former colonies vote massively. They urge their children to do the same; but the latter are not interested. Decades of social segregation and economic discrimination have made it clear to them that the word “French” on their passport is meaningless – there is no equality, no freedom and clearly no fraternity.

Facebook Twitter Pinterest ‘Riots in the [Paris] banlieues had no religious subtext: they were expressions of anger at discrimination and police harassment. Yet the need to belong is a fundamental human need.’ Photograph: Sipa Press/Rex

The process of disenfranchisement was gradual. Riots in the banlieues started erupting at the turn of the 1980s, and gathered pace in the 90s. They had no religious subtext: they were expressions of anger at discrimination and police harassment. Yet the need to belong is a fundamental human need: if French youth of Arab descent could not feel that they belonged to France, what would they belong to? La Démocratie de l’Abstention describes how the conflict between Israel and Palestine – which had been going on for decades already – suddenly caught the imagination of the youth: it was their Vietnam. They had found their brothers overseas.

Youth is the age of self-sacrifice and revolutionary dreams. In the 1960s, young middle class Frenchmen who felt alienated from their conservative milieu idolised Mao’s cultural revolution – no less nihilist than Islamic fundamentalists – dreamed of throwing bombs and sometimes did so. But the middle-class Maoists belonged to a privileged class. They were highly educated. They had the intellectual, economic and social means to move out of their nihilist craze and back into the world. The disenfranchised, ostracised youth are an easy target for indoctrinators of all sorts. The current economic crisis, which hits the youth particularly hard, has even handed more ammunition to fanatics: among the young men who enlist to fight for Daesh, many are actually disenfranchised white youth with no familial links to Islam. Trapped in a binary west v Muslim worldview, some of them have tragically failed to recognise that a newspaper such as Charlie Hebdo, which was standing with Palestine, for ethnic minorities, for equal rights and justice, was on their side – a precious ally: the sole fact that Charlie Hebdo had poked fun at their faith was enough to make its journalists worthy of death.

The attack on Charlie Hebdo will be exploited by the far right, and by the government which will use it as an opportunity to create a false unanimity within a deeply divided society. We have already heard the prime minister Manuel Valls announce that France was “at war with terror” – and it horrifies me to recognise the words used by George W Bush. We are trying to find the narrow path – defending the republic against the twin threats of fundamentalism and fascism. But I still believe that the best way to do this is to fight for our republican ideals. Equality is meaningless in times of austerity. Liberty is but hypocrisy when elements of the French population are being routinely discriminated against. But fraternity is lost when religion trumps politics as the structuring principle of a society. Charlie Hebdo promoted equality, liberty and fraternity – it was part of the solution, not the problem.

• This is an edited version of an article originally published on Mediapart