Much of the anger unleashed by the release of Abdelbaset Ali al-Megrahi, the man convicted of perpetrating the 1988 Lockerbie bombing, feels misdirected. True, British ministers have made themselves look shifty by trying to argue that maintaining relations with Libya had nothing to do with Megrahi's release. And the revelation that Gordon Brown had expressed his desire to Libyan officials that the terminally ill Megrahi should not die in a Scottish jail has embarrassed the Prime Minister.
There is, nevertheless, something synthetic about the row the release has generated, given the legitimate doubts that exist over whether Megrahi was actually responsible for the bombing of Pan Am flight 103. Those who argue that Libyan appeals for Megrahi's release should have been rejected out of hand need to answer how justice would have been served by forcing an individual, who may well be innocent, to spend the final weeks of his life in jail?
There is, of course, more to this affair than the fate of Megrahi. What has helped to make his release so controversial is the suspicion that a regime which sponsored terrorism is being appeased. So the important question is not whether Megrahi should have been released, or whether the British Government had any influence on the decision of the Scottish executive, but whether Western governments should be doing business with a state like Libya.
Over the course of his unbroken 40 year rule (celebrated with such gusto in Tripoli this week) the Libyan leader, Muammar Gaddafi, has sponsored international terrorism, ruthlessly crushed domestic dissent and squandered Libya's vast oil revenues. The outrageous show trial in 2004 of eight Bulgarian nurses falsely accused of infecting Libyan children with Aids offered the world a glimpse of the true face of Gaddafi's regime.
The willingness of Western leaders to deal with Gaddafi dates from 2003, when the Libyan leader offered to scrap a secret nuclear weapons programme in exchange for Western recognition and an end to sanctions. On balance, the West was right to accept that deal.
There are dangers in this approach, not least the demoralising signal that it sends to those Libyans yearning for an end to Gaddafi's misrule. But as in Iran and North Korea, engagement is preferable to a policy of hostile isolation. Libya is no democracy, but it is, at least, no longer sponsoring terrorism abroad, nor seeking to develop weapons of mass destruction. That is the realpolitik justification for reaching out to Libya – and it is a compelling one.
Yet the criticism that engagement with Libya has degenerated into pandering has some merit too. The sense that commercial interests – notably in the oil industry – are being allowed to override concerns of justice and human rights is growing. That is dangerous. History has taught us the dire consequences of our governments becoming cosy with "friendly" dictators.
There is a case for engagement with Libya, even investment. But Gaddafi's regime itself must be kept strictly at arms length. A doctrine of realpolitik that loses all sight of morality and justice ends up undermining its own purposes.