Straw wrote: "Developing a strong relationship with Libya, and helping it to reintegrate into the international community, is good for the UK.
"I do not believe that it is necessary, or sensible, to risk damaging our wide-ranging and beneficial relationship with Libya by inserting a specific exclusion into the PTA [Prisoner Transfer Agreement]."
Straw said that Libya was an "important partner" in the fight against terrorism and illegal immigration.
In another letter, dated November 2008, Straw told the semi-autonomous Scottish government: "I would like to assure you that at both ministerial and official level we are continuing to reiterate to the Libyans that any questions of treatment, possible compassionate release or any application to transfer under the PTA and bail are a matter exclusively for Scottish ministers and Scottish courts respectively.
"The correspondence shows that, throughout, we have made clear that the transfer of Megrahi was a decision for Scottish ministers," the UK foreign office said in a statement after the publication of the letters on Tuesday.
The letters were released after media allegations on Sunday that London had encouraged the Scottish government to make al-Megrahi's available for a potential release, in order to improve trade ties with Libya.
Libyan officials said Al-Megrahi, who is suffering from terminal prostate cancer, has deteriorated sharply since arriving in Tripoli.