The High Court judgment, based on the 1689 Bill of Rights, led to demands for a change in the law by Mr Hamilton and Mr Greer, who were considering an appeal.
Mr Justice May ruled the action against the Guardian should be halted because parliamentary privilege under the Bill of Rights prevented the newspaper from fully defending itself.
Article nine of the Bill said that debates in Parliament should not be questioned by the courts.
A spokesman for Mr Hamilton said: "It means the media can make any allegation they like providing it relates to the parliamentary activities of the MP. All MPs should recognise the incredible danger they face after this ruling.
"Labour MPs need to understand it may have suited them to portray the Tory party as the party of sleaze but they should know that newspapers have got all sorts of nastiness locked up in their vaults which they could pull out in time. It goes well beyond a party matter. It strikes at the heart of the constitution."
Mr Hamilton and Mr Greer had sued over an article last October which alleged that the MP took money in exchange for asking parliamentary questions in a lobbying campaign organised by Mr Greer on behalf of Harrods owner, Mohamed Al-Fayed.
Mr Hamilton, MP for Tatton and a former minister at the Department of Trade and Industry, resigned his ministerial post five days after the article appeared.
The Guardian's counsel, George Carman QC, argued that parliamentary privilege meant that he would not be able to cross-examine possible witnesses, including John Major, and Michael Heseltine, about Mr Hamilton's alleged conduct.
He said he would also be unable to question the MP about evidence he gave to a Commons inquiry into his failure to declare a visit to the Al- Fayed-owned Ritz Hotel in Paris. But in a joint statement, both Mr Hamilton and Mr Greer protested they had been denied the opportunity to clear their names in the courts by the ruling. They said the Bill of Rights was designed to protect elected MPs from intimidation, "not to provide a weapon to intimidate and destroy them".
They added: "MPs should be put on notice that this decision means newspapers now have a licence to print lies about any MP ... confident that the courts are powerless to restrain them, however false, however malicious, however damaging the allegations may be."
Mr Hamilton and Mr Greer said it was imperative for Parliament to reverse the judgment.
Mr Greer said he was unable to use Parliamentary privilege to clear his name. They "utterly repudiated" the allegations of corruption and said it was a "profound denial of justice" to be refused the right to put the evidence before a libel jury.Reuse content