London’s toxic mayoral election highlighted the dangers of identifying solicitors with their clients.

Even if you live outside London, you may be aware of the toxic nature of the mayoral election which took place last week. Thus, it is with considerable caution that I step into issues that arise in the candidacy of Labour’s Sadiq Khan. For the avoidance of any doubt, this column is not an endorsement – nor a criticism – of any of the 12 individual candidates. It is concerned with three issues relevant to the general body politic.

Let me begin with a downright sectarian point. Sadiq Khan is a solicitor. Whether he won or lost (I write before we know, though you will read after we do), we should welcome, as a profession, a member who gets at least to be a candidate for so high-profile a post.

It is time for us to promote qualification as a solicitor as a route to a wide range of jobs in the private and public sphere. Solicitors use a range of skills to resolve the problems of their clients. That should provide just as substantial a base, if not more, for the worlds of politics and business as a capacity for forensic cross-examination and oral dexterity.

So why is Lloyd George the only solicitor to have been prime minister? In part, the answer may be the low expectations of solicitors, habituated to being the junior branch of the profession. Well, this inferiority has to end. That has to begin with education and training, which are not only regulatory issues but developmental ones as well. We need training that provides a strong platform for the kind of career that may peak as Mayor of London or its commercial equivalent.

There is a second professional point. No solicitor should be identified with the views, actions or beliefs of their clients. Allegations on this basis against Sadiq Khan led to a letter of protest in the Guardian signed by 16 lawyers – largely Labour supporters, but including non-sectarian figures such as Sir Geoffrey Bindman and former DPP Sir Keir Starmer MP.

The profession, collectively and corporately, has to come down heavily on this classic slur on lawyers. It is immensely dangerous. Personally, I was rather proud of the rather unserious death threats that I got after defending Justice’s intervention in the case of Abu Qatada. But our point was about the law relating to extradition and the likelihood of torture. It had nothing to do with Justice’s views on the individual person at its centre. You can see the serious effect of this type of contamination in China. A crackdown on dissent is leading defendant lawyers to be dismissed as a ‘criminal gang’ on TV, and a news agency is denouncing them as ‘blabbering about the rule of law, human rights, and justice, and roaming around under the flag of “rights defense”’.

The professional veil should, of course, be opaque in both directions. An association of Mumbai’s lawyers refused to represent Mohammad Ajmal Amir Qasab, one of the assailants in a terrorist massacre, for reasons of ‘patriotism’. Not professionally acceptable. I once signed up to a law centre policy of acting in all criminal cases except those relating to allegations of rape. On reflection, that was understandable, politically correct but – as veteran solicitor commentator James Morton ultimately convinced me – simply wrong.

A criminal lawyer should not choose clients on prejudice as to their guilt or distaste as to alleged crime. You can attack a lawyer for their personal views, just like anyone else; you can certainly attack them if these views infect their professional obligations. But you cannot lazily or maliciously impute the actions of a client to their lawyer; at least, not in any state that values the rule of law.

There is a final, related point. The mayoral election has been dominated by a debate about whether you are contaminated by sharing a public platform with extremists or others whose views are deemed generally unacceptable. That depends, of course, on why you are there – to argue or support. Personally, I live in a liberal bubble bounded by the legal profession in one direction and north London in another.

Usually, I only discuss values with those who pretty much agree with me. But, the other day, I got into a debate with a group of Muslim students who vociferously challenged the right of anyone to be gratuitously offensive to what they saw as sacred. I am not sure that they were persuaded by my arguments on freedom of speech, but the ensuing engagement is what democracy, inclusion and cohesion is all about.

If politicians of all persuasions are not sharing platforms to debate the issues of their time with all-comers, then they should be. More of those politicians should be solicitors; and none of them should have the sins of their clients strung like albatrosses around their necks.

Roger Smith is visiting professor at London South Bank University and former director of human rights group Justice