But was he guilty in the first place?
Normally, I’d put this sort of question firmly into the tinfoil hat category, but a number of people believe Libya was not the perpetrator of the bombing, with Iran and the PFLP-GC being the most frequently cited alternative, and it appears this release was a quid pro quo for his dropping his appeal of his conviction. (See also here)
My guess is that the reality is somewhere in between, that al-Megrahi is the one who done it, but that the prosecution was handled by a bunch of PR glory boys, who screwed up various parts of the trial, and there was a very real worry that he would embarrass the British courts on appeal, so they cut a deal.
That’s my guess anyway.