The gruesome murders carried out by Stephen Griffiths, the so-called "Crossbow Cannibal", have brought untold heartache to the family and friends of the three women he is known to have killed, dismembered and eaten. But how much worse it must be to discover that Griffiths had been identified as a potential risk who had long harboured desires of becoming a serial killer. Could he have been stopped?

When he was just 17, Griffiths was given three years' youth custody for a violent attack on a supermarket manager, whom he slashed with a knife. He was diagnosed as a "sadistic, schizoid psychopath" and later spent time at Rampton high-security hospital, but was not deemed mentally ill. He told probation officers that he saw himself becoming a killer in later life, and a psychiatrist said he displayed a "preoccupation with murder – particularly multiple murder".

In 1992, he was given a two-year prison sentence for affray and possession of an offensive weapon after holding a knife to the throat of a young girl for no apparent reason. The following year, he was put on probation for possessing a knife in public and given a suspended prison sentence for possessing two air pistols.

Here, then, was an obviously disturbed and dangerous individual, who most people will have been horrified to discover was free to carry out his perverted fantasies, with appalling consequences. Could he have been – should he have been – locked away in a mental institution?

The question of what to do with people who are socially dangerous but are not, in the strictest sense, mentally ill has been a source of controversy for hundreds of years. In the past, these so-called "moral defectives" were certifiable if they had "strongly vicious or criminal propensities and require care, supervision and control for the protection of others". A similar definition, by now called a "psychopathic disorder", was included in the 1959 Mental Health Act and retained in its 1983 successor.

However, this Act also required that anyone detained under its provisions – now known as being sectioned – had to be treated in a way "likely to alleviate or prevent a deterioration of their condition". But an argument arose over whether these psychopaths were, in the unfortunate phrase, "not bad but mad". After all, unlike schizophrenics and other mentally ill individuals, whose problems can be improved by drugs and other therapies, their condition could not be alleviated, and was therefore not treatable.

This issue entered the political arena in 1998, with the conviction of Michael Stone for the murders of Lin and Megan Russell in Kent. Stone had a long history of offending and had been diagnosed as having a psychopathic personality disorder. But because psychiatrists did not regard this as treatable, he could not be detained.

Ministers in the last government said that Stone should have been in a secure hospital, simply because he was a danger to others, and decided to plug what they saw as an unacceptable loophole in the law. So they set off on a long and tortuous legislative journey to amend the 1983 Act. Their aim was to do away with the treatability provision, so that a small group of potentially dangerous people who were at liberty could be removed from society, because they might be a risk to others in future. Once identified, these individuals would be assessed by a team of experts and – if deemed sufficiently dangerous – would be locked away in a hospital or in a purpose-built institution, possibly for ever.

The psychiatric community was appalled. It did not want to act as police officers, judges and jailers to people who might, or might not, commit a crime in future. So, for the next eight years, there was much heated debate: special committees were established, umpteen consultations took place and the proposed Bill was redrafted three times.

By the time the new Mental Health Act became law, in 2007, it had been substantially watered down from the original plans, which critics said were simply unacceptable on civil liberties grounds. The Act removed the old requirement that treatment had to involve making someone better, and brought in a new test under which people with a personality disorder could be compulsorily detained if "appropriate medical treatment" was available. The aim was to enable psychiatric hospitals to section people previously considered bad, though not mentally ill – but many experts think that the change from the previous law is marginal.

In Griffiths's case, the decision to keep him in a mental hospital arguably should have been taken in 1991, when he was first assessed. But the old treatability rules still applied then – and it is by no means clear that the new ones would have made any difference. He does not appear to have had any recent contact with psychiatrists that might have led to a diagnosis which would have got him locked away. And without one, how can anyone know?

The court was told that since then, Griffiths had displayed no signs of psychotic illness or a treatable mental disorder. He was, in that old-fashioned term, pure evil – and sadly, we have yet to devise a way of removing that strain from the human psyche.