But he insisted that the British energy giant had not played a role in the release of al-Megrahi, despite the company's admission that it had lobbied for the Lockerbie bomber's release to improve commercial ties with Libya.
"Let us not confuse the oil spill with the Libyan bomber," Cameron told reporters as he stood side-by-side with Obama after their discussions.
Al-Megrahi release 'mistake'
He said that the release of the al-Megrahi, who was convicted for the murder of 270 people killed when an American plane exploded over Scotland, was a mistake.
John Terrett reports on British PM's bid to assuage anti-BP sentiments in the US
"It was the biggest mass murder in British history, and there was no business letting him out of prison," Cameron said, after Obama told reporters that Americans had been "surprised, disappointed and angry" that al-Megrahi had been released.
Cameron dodged US calls for an inquiry into al-Megrahi's release. "I don't need an inquiry to tell me it was a bad decision," he said, pledging that all the facts would be released to the public.
Earlier, Cameron had met US legislators angry at the decision, which was taken by the Scottish government when Gordon Brown was still prime minister.
Cameron was making his first visit to Washington as British prime minister under the shadow of a growing American backlash against BP over the oil pollution in the Gulf.
He was forced to walk a delicate line, with one eye on British pensioners and investors in the embattled company, and the other on an angry American public.
He told reporters it was important to both Britain and the US that BP remain a "strong and sound" company so it could pay compensation for the spill and for the sake of both countries' economic interests.
The two leaders presented a united front on the war in Afghanistan, sanctions against Iran and efforts to encourage the faltering global economic recovery.
Despite the difficulties over Lockerbie and the oil spill, both men were keen to emphasise the importance of good ties between the two countries.
Al Jazeeras Rosalind Jordan, reporting from Washington, said that the meeting had been a success.
"I would imagine that advisors for both the prime minister and the president are pleased with the visuals of that start of a new relationship," she said.
After the talks, Obama gave the US-UK ties a boost when he echoed previous leaders in paying tribute to the importance of the relationship. "We can never say it enough. The United States and the United Kingdom enjoy a truly special relationship," he said.