Editors of tabloid newspapers often make enemies. An essential part of their trade, as with all journalism, requires the airing in public of things that rich, powerful and famous people would prefer were kept secret. At best, that is a vital service to democracy; at worst, it is salacious intrusion.

Government spin doctors also make enemies. But, by definition of the job, they also have friends in high places. So Andy Coulson, former editor of the News of the World, now David Cameron's director of communications, has surely amassed a rich array of allies and foes in the worlds of media and politics.

All of which makes it very hard for the public to know what to make of allegations that he has lied about the extent of his knowledge of illegal phone hacking by journalists under his command.

Mr Coulson has always strenuously denied that he knew his underlings were breaking the law to break stories. Former staff say that is untrue and that the boss knew everything.

It is, of course, easy to be disparage the "dark arts" of tabloid reporting alleged to be rife at the News of the World. But there is a boundary between legitimate journalistic investigation that might sometimes require forms of subterfuge to unearth a story in the public interest, and snooping around on the wrong side of the law for the simple sake of a good scoop. Different media outlets and different journalists have their own sense and ethical judgment about where that boundary falls. It isn't always clear.

It does not help, meanwhile, that there is a much greater flow of information and tips between police and reporters than either would readily acknowledge in public, and which might make the former reluctant to launch criminal investigations against the latter.

The Metropolitan Police's role in the whole affair is hardly less murky than Andy Coulson's. Many of those who suspect their phones were hacked have tried in vain to establish whether that was, in fact, the case. New questions about the extent to which the police might have withheld that information from senior politicians are raised by reports in today's Observer. It is becoming increasingly difficult to dispel the impression that, for whatever reason, the Met did not feel especially inclined to respond to claims of widespread phone hacking by journalists at the News of the World with the kind of investigative diligence that the allegations demanded.

There was an investigation when the allegations first surfaced; a reporter and a private detective were jailed. A rogue case, Mr Coulson said, an unfortunate exception. He unambiguously denied any complicity before a Commons select committee. That account does not match the one given in an article in today's New York Times of systematic hacking.

Either Mr Coulson lied about what he knew or he had a flimsy grasp of what went on in his newsroom. Either way, his qualification to run government media operations comes into question. So, by extension, does Mr Cameron's judgment in appointing him.

The first rule of being a spin doctor is not to become the story. Alastair Campbell broke that dictum in his row with the BBC over the "dodgy dossier" of Iraqi weapons of mass destruction. The career of Gordon Brown's media henchman Damian McBride ended when he appeared at the centre of allegations of a shabby smear operation.

Andy Coulson had been at the centre of a media furore that cost him his job before he went to work for the Conservatives. Surely the prime minister, then opposition leader, knew it was only a matter of time before his new appointee was in the headlines again.

That does not prove any wrongdoing. The truth in this matter is obscure. What investigation there has been is incomplete. But the prime minister must surely want to establish beyond doubt whether a pivotal figure in his administration is fit to be at the heart of power. He once said, in the context of another scandal, that "sunlight is the best disinfectant". A nasty pall of shabby practice has descended on Mr Coulson. He, too, would presumably like to have it dispelled in a thorough investigation. The prime minister should allow some of that famously purgative sunlight to shine on his communications director.