The ruling by a three-judge panel of the 2nd U.S. Circuit Court of Appeals in Manhattan followed a similar decision by a San Francisco-based appeals court in January. Both rejected lawsuits by investors seeking to make the agency pay for failing to discover the fraud.
The "SEC's actions, along with its regrettable inaction," are shielded by rules protecting government employees from lawsuits when they act - or fail to act - based on judgment, rather than ignoring a statute or regulation, the court in New York wrote.
Investors argued that the SEC negligently failed to discover Madoff's fraudulent handling of roughly $20 billion despite receiving numerous complaints over 16 years. They said the agency repeatedly failed to alert branch offices of ongoing investigations and failed to properly review complaints and follow up on disputed facts elicited in interviews.
"The SEC missed many opportunities to uncover Madoff's multibillion-dollar fraud," the appeals court said. But it added that the law was clear that lawsuits against the SEC over the failures could not succeed.
Madoff pleaded guilty in 2009 to fraud and is serving a 150-year prison sentence.
Lawyers for investors believed they were wronged both by Madoff and the SEC and their rights needed to be vindicated, Attorney Howard R. Elisofon said in a statement after the ruling.
"We recognized that challenging the SEC would be difficult, but this was a case that needed to be fought," he said.
Government lawyers declined through a spokeswoman to comment.
In a 2009 interview with the SEC inspector general, Madoff said he had the impression that "it never entered the SEC's mind that it was a Ponzi scheme." An inspector general's report later concluded that the SEC missed red flags over many years as inspectors argued over the findings of numerous probes and SEC employees failed to communicate with one another, allowing credible complaints to go relatively unchecked.
Madoff said SEC examiners never requested basic records to corroborate the results of his private investment business, though he was "worried every time" they inspected his business that they would catch him.
"It was a nightmare for me," he said. "I wish they caught me six years ago, eight years ago."