Prisoner Arthur Duncan is guilty of a truly chilling crime.

In 1970, when he was 18, he raped and murdered 22-year-old Linda Bull, a stranger, by strangling her with her own tights.

He used part of her dress as a gag. Parole boards have continually judged that he should not be released because of the risk he poses to the public and, in the eyes of most, that is also a just penalty for what he did.

It will therefore cause understandable outrage that this dangerous criminal could be compensated for what the judge called "distress and frustration" caused by failures in the way his case has been handled in prison.

Compensating Duncan helps no-one and will sicken his victim's friends and family. Yet, while it is unfortunate to say the least that Duncan may be entitled to money, the nub of this case is access to rehabilitation. This situation was avoidable and has only arisen because of a failure during a six-year period to allow Duncan access to courses that could have addressed his alarming sexual fantasies.

Rehabilitation courses should be required for all manner of prisoners, even for individuals such as Duncan, in the interests of building a safer Scotland and a safer environment for those who work with prisoners.

It is important to stress that having access to such courses would in no way assure Duncan of release; nor should it. While his crime took place more than 40 years ago, he has much more recently had sinister fantasies, some of them about specific women featured in newspapers. He fantasised about going to one woman's home and tying her up. While this emphasises how important it is that his sexual thoughts are challenged and addressed, instead of being left unchecked, it also underlines how it is correct that he has been refused parole. It is likely he will never be able to convince the parole authorities that he is fit to be released, no matter how many rehab courses he undertakes.

Lord Glennie's ruling was preliminary; it remains to be seen whether it will be upheld. Even so, two further issues arise. The first is whether there is enough money available to fund high-quality, evidence-based rehab courses. The Scottish Government must ensure such programmes are available wherever appropriate, not just to avoid compensation payouts but, above all, to address prisoners' destructive and dangerous behaviour.

The second is whether, if this ruling is upheld, it could open the door to other similar cases. Depressingly, that has to be a possibility.

There is one final point that must be urgently addressed in this particular case. Duncan was found at one stage to have had in his possession a DVD featuring females being tied up and attacked. This beggars belief. The public trusts that prisoners' offending behaviour will be addressed while in prison. Not only have the justice authorities apparently let the public down during a six-year period on that score, but the system has failed to prevent him fuelling his nasty sexual desires by viewing depraved material.

For Scottish ministers, alarm bells should be ringing.