The resignation of Environmental Protection Agency Administrator Anne M. Burford was carefully orchestrated by White House and other administration officials who had to persuade a "stubborn and defiant" President Reagan, as well as Burford, that her departure was politically essential, administration sources said yesterday.

These sources said that top White House officials, led by chief of staff James A. Baker III, concluded last week that Burford had to go and that Reagan would agree to it only if she was allowed to "withdraw gracefully."

Once again, Reagan's staff was pitted against him, as has been the case many times before during his administration.

Reagan was described as unwilling to believe that Burford had done anything wrong. He reportedly saw her as a target of the media and environmental critics who have long objected to his policies and who were using Burford's difficulties as an excuse to attack his administration.

While the White House sought to give to Burford's resignation Wednesday the appearance of a graceful withdrawal, officials acknowledged yesterday that she was, in fact, forced to quit.

"The president was sincere in saying he regretted her going," said one official. "But the fact is that Baker and White House counselor Edwin Meese handed him Burford's head on a silver platter, and he had no choice but to accept it."

Meese was informed Tuesday in a telephone call from Burford's lawyer, Douglas Bennett, that the White House effort to force Burford's resignation had succeeded, according to White House communications director David R. Gergen. The news came as no surprise. Sources said that for several days Baker and other top White House officials had been encouraging moderate Republicans, including House Minority Leader Robert H. Michel (R-Ill.) and New Jersey Gov. Thomas H. Kean, to call for Burford's removal. But they recognized that the president was most likely to listen to Meese, a longtime adviser who had been Reagan's executive secretary in California when Reagan was governor.

Meese, considered the most conservative of the president's top advisers, reportedly went to Reagan after a conversation with Baker and Cabinet secretary Craig L. Fuller and persuaded the president to accept Burford's resignation. Sources said Meese worked in close consultation with an ally in the Cabinet, Interior Secretary James G. Watt, who has been Burford's mentor.

According to these administration sources', Watt was helping Burford to agree to resign at almost the same time that Meese was convincing the president to accept her resignation.

The groundwork had been laid in a meeting in San Francisco the previous Friday, when aides tried to persuade the president to fire Burford. He told them he would not force her out. However, Reagan agreed that if he were asked by reporters whether he would accept Burford's resignation, he would brush it off saying it was a hypothetical question.

But Reagan was never asked the question.

However, when he was asked, while touring a plywood mill in Klamath Falls, Ore., on Saturday, how long Burford would be on the job, Reagan replied, "as long as she wants to."

Even though Reagan had foreclosed firing Burford, Meese and Watt had securely set the wheels in motion for Burford's departure. "Watt came to us in behalf of Burford and went back to Anne in behalf of us," one White House official said yesterday.

"I think Watt played quite a significant role in communication," said another administration official. "Watt is much more dispassionate. He could do what she couldn't do. He could analyze her situation and tell her what it was. He could tell her, 'Your situation is not good.' "

Meese was the one official who could assure Reagan that Burford's departure would "be done right," as another official put it. "Meese was the only one who could do it and give the president confidence it was being done in good taste . . . . She couldn't be run out of town on a rail without it making Reagan look tacky."

It was Meese who received the phone call that Burford was ready to resign; it was Meese whom she saw before delivering her resignation to the president; it was Meese and Watt who went to the White House residential quarters with her; and it was Meese who spoke with her afterwards in his office.

Other White House officials had given their blessings to the growing demand among Republicans for Burford's removal. In urging on Wednesday, hours before Burford quit, that she step down, New Jersey Gov. Kean knew that the White House welcomed his statement. Administration and New Jersey sources said Kean first asked Richard S. Williamson, White House assistant for intergovernmental affairs, whether New Jersey, which badly needs federal anti-pollution funds, would be stigmatized if he called for Burford's resignation.

Williamson, who reports to Baker, said it would be "okay with the White House," one source said.

"Tom left that conversation with the feeling that he had better not waste any time in calling for her resignation," the source said. The next day Kean flew from New Jersey to Washington, where he held a press conference urging Burford to "step down immediately."

Yesterday, the White House attempted to draw a veil of secrecy over the events leading up to the resignation, reportedly at Reagan's personal direction. Despite this, officials detailed events leading to Burford's resignation.

They said Baker, Fuller and presidential assistant Richard G. Darman, among others, had become convinced by early last week that the EPA controversy was damaging the Reagan presidency at the very time that signs of economic recovery were giving it a boost. Public opinion surveys showed that a significant majority of Americans were convinced that the EPA and Reagan were favoring business at the expense of the environment.

Then White House counsel Fred F. Fielding told Baker that former EPA inspector general Matthew L. Novick had warned Burford nearly a year ago of conflicts of interest involving her former aide, James W. Sanderson. Baker became convinced, officials said, that Burford should be ousted from the EPA before the Justice Department completed its investigation into the Burford-Sanderson relationship.

"This is a can of worms, and we've got to put EPA behind us so we can go on to other things," one official quoted Baker as saying.

At first, Baker and his allies didn't know if Meese would join them. Burford reported to Meese through Fuller. It was Meese whom Burford called when she decided to fire one of her deputies, toxic waste chief Rita M. Lavelle, touching off the latest round of controversy over EPA.

But, according to a source close to Baker, he sought Meese's help in getting rid of Burford. Baker also enlisted the assistance of Darman, Williamson, and legislative liaison Kenneth Duberstein.

All of them welcomed House Minority Leader Michel's statement that Burford should step down. Last Thursday, when White House spokesman Larry Speakes was telling reporters in San Francisco that Reagan had "full confidence" in Burford and that White House officials had "held no conversations" about replacing her, officials were saying, without allowing their names to be used, that Michel was considered a very good ally of the White House.

"When Larry said that the president had 'full confidence' in Burford it was true, but the rest of it was baloney," one White House official said. "Larry did what Baker and the rest of them wanted him to do, even though he knew they wanted Burford out."

Another official who also did what he was told was White House communications director Gergen, who called The Washington Post on Saturday night to reverse previous comments he had made and to say Reagan still had full confidence in Burford. He tried to downplay news reports that evening on CBS and NBC that Burford would soon be gone.

Fuller also played a key role, working to install a professional management team at EPA after a spate of firings and resignations. But the professional bureaucrats he put into the agency complained to him that they didn't want to go back there if they had to work with Burford.

"She was very abrasive; she wasn't going to accept direction; she couldn't get along with anybody," one official said. "This soon became apparent to Craig and to the entire White House, except for Reagan."

But with the help of the White House staff, the president ultimately did what those who worked for him thought it was in his best interests, and made a change in EPA.