When the SEC in March accused former Goldman Sachs board member Rajat K. Gupta of leaking corporate secrets to a hedge fund billionaire, Gupta protested that the agency was treating him unfairly.

Although the charges were similar to those the SEC had filed against dozens of others in related insider trading cases, only Gupta was charged administratively, denying him a trial by jury and the safeguards afforded by the federal rules of evidence.

Now a judge has ruled that Gupta can pursue his complaint against the SEC in federal court.

Judge Jed S. Rakoff ruled Monday that Gupta can move forward with a lawsuit arguing that the Securities and Exchange Commission singled him out for uniquely unfavorable treatment in violation of the Constitution’s guarantee of equal protection under the law.

“Here . . . we have the unusual case where there is already a well-developed public record of Gupta being treated substantially disparately from 28 essentially identical defendants, with not even a hint from the SEC . . . as to why this should be so,” Rakoff wrote.

The SEC might not be hinting as to its reasons, but Gupta is doing so.

In his lawsuit, he contends that “the only plausible inference” is that the SEC was “shoring up a meritless case by disarming its adversary.”

At a time when politicians and other critics have accused the SEC of not being tough enough, the Gupta matter involves allegations that it was overzealous.

Gupta is trying to win an order blocking the SEC from going after him administratively. His case against the SEC will proceed in court in Manhattan while he awaits an administrative trial, scheduled for six months from now, in the SEC’s case against him.

His case is one of the more remarkable to emerge from a federal crackdown on insider trading.

From 1994 to 2003, Gupta was the head of the management consulting firm McKinsey & Co., serving as a senior adviser to an international business elite. He served on the boards of and is accused of leaking confidential information from Goldman Sachs, the Wall Street powerhouse, and Procter & Gamble, the consumer products giant.

The alleged beneficiary of his tips, billionaire Galleon Management boss Raj Rajaratnam, was convicted of fraud and conspiracy charges in May after a trial that focused in part on the information that Gupta allegedly provided.

In his lawsuit, Gupta argues that the SEC was trying to retroactively penalize him under the Dodd Frank Act, which was signed into law last summer in response to the financial crisis. His alleged violations took place from June 2008 to January 2009, before the law was enacted, the suit says.

The SEC had asked Rakoff to dismiss Gupta’s complaint, arguing that the federal court lacked jurisdiction.

“We are reviewing the decision and will proceed in a manner that maintains the commission’s authority to best serve the interests of investors and the integrity of the markets,” SEC spokesman John Nester said.

Through a spokesman, an attorney for Gupta declined to comment on Rakoff’s ruling.