‘It is easier for the right to move left on economics than it is for the left to move right on identity & culture.” So tweeted politics professor and TV pundit Matthew Goodwin on the morning of the Tory election victory as the moral of the night before. The Tories, so the story goes, won over huge swaths of Labour voters by a willingness to back greater state intervention and increased public spending. Labour lost them by a refusal to shift on questions of crime or diversity.

Long before the Tory demolition of Labour’s “red wall”, it had become accepted almost as a given that the working class was intrinsically socially conservative. The abandonment by working-class voters of social democratic parties throughout Europe, and their embrace of populism, was seen by many as a rejection of the liberal values that define the left.

The working class, runs the argument, is rooted in communities and cherishes values of family, nation and tradition. It has little time for liberal individualism or for the language of diversity and rights. That belongs to the “metropolitan liberals” and to a different political tradition. Indeed, many argue that if Britain’s electoral system were not rooted in a first-past-the-post system, the Labour party would have already broken into two, one part representing the socially conservative but economically leftwing working class, the other liberal metropolitans. Labour now faces a choice: either accept that its traditional working-class voters are gone forever or abandon liberal social policies.

The trouble with this argument is that the key feature of Britain over the past half century has been not social conservatism but an extraordinary liberalisation. The annual British Social Attitudes survey, which began recording public attitudes in 1983, has tracked “the onward march of social liberalism”. On a host of issues, from gender roles to gay marriage, from premarital sex to interracial relationships, Britain has liberalised to a degree that would have left the average Briton of the 1980s aghast. It’s not just metropolitan liberals but society as a whole, including the working class, which has embraced this change.

So much has Britain liberalised that those who still cling to values that would have been consensual just 30 years are now seen as not properly British. When Muslim parents in Birmingham protested against primary schools teaching children about gay lifestyles, they were not welcomed as embodying solid working-class values, but criticised for not being properly integrated into British life.

Facebook Twitter Pinterest ‘When Muslim parents in Birmingham protested against primary schools teaching children about gay lifestyles, they criticised for not being properly integrated into British life.’ Photograph: Aaron Chown/PA

In today’s discussions about working-class attitudes, “social conservatism” has been redefined to mean not opposition to gay marriage or premarital sex, but support for a far narrower cluster of views: harsher punishments for criminals, a more patriotic attitude and, in particular, a clampdown on immigration. Even here, the reality is more complex. It’s true that there are deep class divides on immigration, with differences between the views of unskilled workers and those of professionals being the widest in Europe. Yet, nearly a third of unskilled workers are “pro-immigrant” and almost half think that Britain should allow in “many” or “some” migrants from poorer European countries. That’s a sizable contrarian minority within a supposedly uniformly hostile working class.

Equally telling are the reasons for hostility to immigration. Sociologists Vera Messing and Bence Ságvári, using data from 20 European nations, have shown that the scale of immigration has little impact on anti-immigrant attitudes. In societies in which trust is low and social solidarity weak, hostility towards migrants is high, even when immigrants are few in number. Where trust in public institutions is high and social stability strong, people are more open to immigration. The BSA similarly found that attitudes to immigration were intertwined with issues of trust.

Working-class wariness of immigration is not an expression of an innate social conservatism but of the loss of trust, the breaking of social bonds and a sense of voicelessness. Working-class lives have been made more precarious not just through material deprivation, but through the erosion of the more intangible aspects of their lives – their place in society, the sense of community, the desire for dignity. Immigration has become symbolic of this loss. We should not, however, confuse anger at social atomisation and political voicelessness with social conservatism.

Historically, hostility to liberal individualism has taken conservative and radical forms. Conservatives saw history, tradition and the nation as the means by which the individual became part of a greater whole. For radical critics of liberalism, an individual realised himself or herself not through tradition but through struggles to transform society, from battles for decent working conditions to campaigns for equal rights. These struggles created organisations, such as trade unions and civil rights movements, which drew individuals into new modes of collective life and forged new forms of belonging.

These broad ways of thinking of “community” have long coexisted in tension. But in recent years, as trade unions have weakened and social movements crumbled, it has seemed for many that the only form of collective politics left is that rooted in conservative, Burkean notions of national or ethnic identity.

At the same time, many sections of the left have also given up on traditional modes of social change, retreating instead into the vapidity of identity politics and diversity talk. In so doing, they have often abandoned not just class politics, but their attachment to traditional liberal values as well, transforming the meaning of equality and rejecting free speech.

The problem is not that metropolitan liberals have become too liberal or the working class more conservative. It is that social and economic changes have unstitched the relationship between the social and the liberal that defines the left; the relationship between a defence of community, of policies that put social need before private profit and a defence of rights, whether of gay people or migrants, and of opposition to unequal treatment. It’s a relationship expressed throughout the history of working-class struggles, from 19th-century opposition to slavery, to the defence of Jewish communities against Oswald Mosley’s Blackshirts in the 1930s, to the support for the Grunwick strikers in the 1970s.

Today, the unpicking of that relationship is visible in everything from accommodation to antisemitism and anti-migrant rhetoric, on the one hand, to the easy dismissal of working-class voters as ignorant and racist, on the other. The challenge for the left is not to embrace social conservatism but to reforge the link between the social and the liberal.

• Kenan Malik is an Observer columnist