Environmental Protection Agency Administrator William D. Ruckelshaus abruptly resigned last night, and officials said he is likely to be replaced by one of his principal deputies, Lee M. Thomas.

Ruckelshaus is the second high-level administration official to quit since Reagan's reelection to a second term. Education Secretary T.H. Bell previously announced that he was leaving.

In an exchange of letters, Ruckelshaus said that the troubled agency he inherited "is righted and is now steering a steady course." President Reagan said he was accepting the resignation with "great regret."

Some sources said Ruckelshaus was unhappy with the prospect of cuts in the EPA's operating budget of as much as 30 percent as part of the administration's proposed spending reductions.

A Sierra Club spokesman yesterday praised Ruckelshaus for his attention to health and safety concerns, but said Reagan had listened instead to the budget-cutting recommendations of Office of Management and Budget Director David A. Stockman.

Others in the administration said Ruckelshaus was simply eager to return to Seattle, where he served as vice president of the Weyerhaeuser Co., a wood products firm, until Reagan called on him in March 1983 after allegations that the EPA had mismanaged the regulation of toxic waste dumps forced Anne M. Burford to resign as the agency's administrator.

"He thinks that he has done what he came here to do and now it's time to do something else," a high-level EPA official said.

In Washington state, Republicans have long considered Ruckelshaus a prime prospect to run for the governorship or a Senate seat.

Thomas, the man favored to replace his boss, is assistant administrator in charge of the agency's hazardous waste programs. In this capacity, he heads the $1.6 billion "Superfund" that Congress created to clean up the nation's most dangerous toxic waste sites.

A veteran bureaucrat who gained recognition by leading a federal task force that dealt with dioxin contamination at Times Beach, Mo., Thomas was sent to the EPA in February 1983 to help improve the management of the then-scandal-ridden agency. He replaced Rita M. Lavelle, whose revelations about mismanagement of the Superfund triggered the scandal and led to her dismissal.

A month later, Burford stepped down under heavy fire from congressional critics and the White House staff. Reagan turned to Ruckelshaus, who had forged a reputation as an environmentalist when he took office as the agency's first administrator in 1970.

In the president's letter to Ruckelshaus, he said the EPA chief had made "an extraordinary personal sacrifice" to return to government.

"Since reassuming control of EPA, you have performed your duties in an exemplary manner and have justified fully the faith which I and so many Americans have in you," Reagan wrote.

Ruckelshaus said he felt a "sense of accomplishment" from his work at the EPA.

"Employe morale is high, first-rate presidential appointees are in place, a management system has been installed that is functioning well and all of the programs have generated momentum," Ruckelshaus wrote Reagan. "In short, the ship called EPA is righted and steering a steady course."

He said his resignation is effective Jan. 5.

But Ruckelshaus, 52, fired as deputy attorney general by President Richard M. Nixon in 1973 because he had refused to fire special prosecutor Archibald Cox, had made it known to friends that he desired to leave. Last year, his wife, Jill, an outspoken activist, was removed by Reagan from her seat on the U.S. Commission on Civil Rights.

Rep. James H. Scheuer (D-N.Y.) said Ruckelshaus' resignation "wasn't surprising, considering the White House's unwillingness to heed even a modest acid rain proposal. This may be his second resignation of conscience."

Rep. John D. Dingell (D-Mich.), chairman of the House Energy and Commerce Committee, said that completing his job may not be the entire reason Ruckelshaus resigned, and that Al Alm, the EPA's deputy administrator, also was leaving the agency.

"The situation is developing, and the first appearance may not be reliable," Dingell said, adding that the resignation "probably is not solely of Ruckelshaus' choice."

"My concern is the administration might be seeking, very unwisely, the kind of administrative, legislative chaos they were beset with . . . up until the time Ruckelshaus took over," Dingell said.

White House spokesman Larry Speakes said a successor would be named in a few days.