Stanley Sporkin, who was the scourge of industry in the 1970s as the crusading chief enforcement officer of the Securities and Exchange Commission and who later had a colorful and controversial tenure as a federal judge in Washington with strongly worded rulings on high-profile cases, died March 23 at a hospice center in Rockville, Md. He was 88.

The cause was congestive heart failure, said his daughter, Elizabeth Sporkin.

Judge Sporkin was nothing if not an activist in interpreting how the law should be applied, in cases large and small.

At the SEC, where he spent seven years as the agency’s director of enforcement, he led lawyers — whom he called “the finest law firm in the country” — in bold actions against such well-known companies as Gulf, Exxon, Mobil, Lockheed, R.J. Reynolds and 3M for trying to bribe political figures in foreign countries.

One of Judge Sporkin’s first major SEC cases resulted in the 1974 conviction of George Steinbrenner, a shipbuilder and owner of the New York Yankees, for illegal campaign contributions. The chairman of Lockheed was ousted after admitting to funneling $22 million in payoffs to foreign politicians.

“I was told that this was done all over the world,” Judge Sporkin told the New York Times in 1990. “My answer was that it is not legal, and it is wrong, and that you cannot accept these shortcomings just because everyone is doing it.”

At both the SEC and later as a federal judge, he often showed a quick mind and sharp tongue in courtroom battles.

“He’s despotic, offensive many times,” one of his legal adversaries, Milton S. Gould, said in 1977, “but he’s instilled a little morality in the business community.”

During his 14 years on the U.S. District Court for the District of Columbia, Judge Sporkin rendered decisions involving street-level drug dealers, the impeachment of a federal judge, a billion-dollar savings-and-loan scandal and whether one of the world’s largest computer companies, Microsoft, operated as a monopoly.

He could be pugnacious on the bench, asking pointed questions of lawyers on both sides of a legal issue. He often leaned back in his chair with his eyes closed, leading some observers to wonder whether he had fallen asleep — only to fire off more questions. One time, he leaned so far back that his chair flipped over.

It was in Judge Sporkin’s courtroom in 1989 that a convicted drug dealer admitted he provided cocaine to then-D.C. Mayor Marion Barry.

“Because I don’t want to look like a fool,” Judge Sporkin asked onetime city employee Charles Lewis, “was one of the individuals you gave cocaine to the mayor of this city?”

As lawyers approached the bench, seeking to have the testimony given in private, Judge Sporkin insisted it remain on the public record.

“Yes, your honor, crack cocaine,” Lewis replied. “No question about it.”

The incident touched off a major scandal and led to Barry’s subsequent conviction for possession of cocaine.

In 1990, Judge Sporkin presided over the case of Charles H. Keating Jr., who challenged federal authority to seize his failed Lincoln Savings and Loan Association. Keating ransacked the business for his personal gain, ultimately leaving taxpayers on the hook for $3 billion.

When Keating’s lawyers objected to the tough questioning of their client, Judge Sporkin bristled, saying, “You’re not going to strong-arm this court.”

He charged Keating with “looting” his savings and loan and asked rhetorically how lawyers and accountants had allowed him to get away with stealing tens of millions of dollars without speaking up.

“Where were these professionals,” he asked, “when these clearly improper actions were being consummated? . . . Why didn’t any of them speak up or disassociate themselves from the transaction? . . . What is difficult to understand is that with all the professional talent involved (both accounting and legal), why at least one professional would not have blown the whistle to stop the overreaching that took place in this case.”

Judge Sporkin’s rhetorical question was seen as a call of moral reckoning.

“That remark caused more reexamination on the part of the bar than any other aspect of the Keating proceedings,” law professor Joel Seligman said at the time. “He wasn’t issuing an order, but posing a tough question that no one was asking.”

In some of his cases, Judge Sporkin was charged with judicial overreach, browbeating lawyers and trying to shape the law to his own vision. In 1995, he rejected an antitrust settlement between Microsoft and the Justice Department, saying the software giant deserved harsher sanctions. Ultimately, he was overruled by an appeals court, which said he had “exceeded his authority.”

Judge Sporkin challenged congressional impeachment procedures in 1989, when he ruled that a Florida federal judge, Alcee L. Hastings, could not be removed from office because his case was reviewed only by a committee of 12 senators, not by the entire Senate.

The decision was voided after the U.S. Supreme Court ruled, in a separate case, that the judiciary could not intervene in the impeachment process. In any case, Hastings got the last laugh: Since 1993, he has been a member of the House of Representatives — the body that once impeached him.

In other cases, Judge Sporkin blocked federal agents from performing random drug searches on buses, calling such actions “repugnant to this nation’s constitutional values.” He also ordered Ralston Purina to pay $12 million to a competitor, Alpo, for suggesting in advertisements that its Puppy Chow could prevent hip dysplasia in dogs. Finding that Alpo had also engaged in deceptive advertising, he ordered each company to pay the other’s legal fees.

Judge Sporkin said one of his most satisfying cases involved a U.S. citizen, Hugo Princz, whose family was living in Slovakia at the outbreak of World War II. Princz and other family members were held in Nazi concentration camps, where his parents, two brothers and a sister were killed.

Decades later, Princz sought reparations from the German government, but the U.S. State Department fought the effort, saying it would be a violation of German sovereignty. After Judge Sporkin’s initial ruling in Princz’s favor was overturned, he kept the case alive by allowing lawyers to sue German companies for which Princz had been required to give forced labor during the Holocaust.

President Bill Clinton also took up the cause, and a settlement was reached with the German government in 1995, with $2.1 million paid to Princz and 10 other Holocaust survivors.

“I don’t know of any case that I have had,” Judge Sporkin said at the time, “where there was so much merit to the cause of the action brought by the plaintiff.”

Stanley Sporkin was born Feb. 7, 1932, in Philadelphia. His mother was a homemaker and his father a judge who desegregated a Philadelphia swimming pool in the early 1950s.

“The whole concept I had of doing justice came from watching him, when he would do the right thing,” Judge Sporkin told The Washington Post about his father in 2000. “Doing justice — that’s what judges have to do.”

After graduating from Pennsylvania State University in 1953, Judge Sporkin became a certified public accountant and then received a law degree from Yale University in 1957. He moved to Washington in 1961 to join the SEC after briefly working in private practice.

“I always found clients were interested in getting as close to the edge of the law, one leg dangling over the line,” he told The Post in 1977. “If you didn’t do it, they’d say there was always a guy down the street who had done it for a friend. There seemed to be something wrong with that kind of atmosphere, to lend your God-given talents to that.”

As the SEC’s chief enforcement officer from 1974 to 1981, Judge Sporkin held dozens of U.S. companies accountable in cases involving international bribery. He advocated for passage of the Foreign Corrupt Practices Act, which became law in 1977.

Judge Sporkin also played a small but significant role in the Watergate scandal in the 1970s, after he had advised SEC Chairman William J. Casey to ignore a request to delay an investigation of financier Robert L. Vesco. Vesco, who became a fugitive in Cuba, had secretly given $200,000 — paid in $100 bills delivered in a suitcase — to the reelection campaign of President Richard M. Nixon.

Two former members of Nixon’s Cabinet, Attorney General John N. Mitchell and Commerce Secretary Maurice Stans, went on trial in 1974 on charges of conspiracy and obstruction of justice. (Both were acquitted.)

During the trial, Judge Sporkin testified that Casey was not part of the scheme to hide Vesco’s money. He said he told Casey, “Someday you are going to be thankful for relying on my judgment in this matter.”

Casey emerged from Watergate unscathed and went on to become director of the Central Intelligence Agency. In 1981, he named Judge Sporkin the agency’s general counsel.

At the CIA, Judge Sporkin issued a legal opinion justifying the Reagan administration’s secret sale of arms to Iran in the mid-1980s. He was grilled by Congress in 1987 over his statement that the president could authorize “a certain activity in a foreign country” without telling Congress if he deemed it “necessary in the interest of national security.”

Judge Sporkin’s nomination to a federal judgeship by Reagan was held up for months by senators who opposed his activism at the SEC before he was confirmed in December 1985.

After retiring from the bench in 2000, Judge Sporkin had a private law practice that included acting as an “ombudsman” and public sounding board for the petroleum producer BP. He was a resident of Chevy Chase, Md.

Survivors include his wife of 64 years, the former Judith Imber of Chevy Chase; three children, Elizabeth Sporkin of Westfield, N.J., and Daniel Sporkin and Thomas Sporkin, a lawyer and former enforcement director at the SEC, both of Bethesda, Md.; a sister; and five grandchildren.

On the final day that Judge Sporkin served on the U.S. District Court, about a dozen other judges sat in the gallery to watch. When the final case had been heard, one of those judges, Norma Holloway Johnson, rose and said to Judge Sporkin, “You have brought to this bench a resolute sense of independence, dignity, courage, compassion and common sense in the pursuit of justice. . . . To say the least, you have always called things as you see them.”