President Reagan yesterday named William D. Ruckelshaus to head the troubled Environmental Protection Agency and said he had given him direct access to the Oval Office and "the broad, flexible mandate he deserves" to make changes at the agency.

Reagan went further in a private discussion with Ruckelshaus before the announcement, assuring him that he would report directly to the president rather than through a Cabinet council headed by Interior Secretary James G. Watt, sources said.

This independence was one of the assurances Ruckelshaus sought as a condition of returning to the agency he administered from 1970 to 1973. Friends of Ruckelshaus said yesterday that he is proud of what he accomplished as the EPA's first administrator and was deeply concerned about accusations that the agency was favoring powerful industries at the expense of the environment.

When Reagan called Ruckelshaus last Thursday to offer him the job, Ruckelshaus responded with a statement of concern about the EPA, according to sources. Ruckelshaus told Reagan that the agency "is dealing with things that go very, very deep in the American psyche" and that Americans wouldn't trust their government if they didn't think it could deal with toxic wastes, the sources said.

At the meeting yesterday Ruckelshaus was quoted as saying that "there had to be mutual trust between us and that we had to get the very best people we could get, people of competence and integrity." Reagan responded by telling Ruckelshaus that he would have the resources he needed and the White House backing to "set things right" at the EPA, which is the focus of investigations by six congressional panels and the Justice Department.

In turning to Ruckelshaus, 50, to clean up an agency that top White House officials have described as a severe political trouble spot, Reagan followed two patterns of the past.

When he was governor of California, Reagan tried to turn aside environmental criticism by choosing a lumberman with a conservationist record as his top natural resources administrator. And when his presidential administration has faced a crisis, Reagan has reached out to veterans of the Nixon and Ford administrations, as he did in choosing George P. Shultz as secretary of state after the resignation of Alexander M. Haig Jr.

White House sources said that Reagan, who had resisted firing EPA Administrator Anne M. Burford, who resigned earlier this month, readily agreed that Ruckelshaus was the best person available for the EPA and was eager to get him.

"The president thinks he has a good record on the environment, that it has been distorted and that this will show where he really stands," one White House official said.

Reagan said in nominating Ruckelshaus yesterday that his policies, which have been assailed by environmental groups, have "always been pro-environment."

Even before Burford resigned on March 9, under heavy pressure from administration officials who orchestrated her departure, some White House aides were eager to have Ruckelshaus return to the EPA.

Their concern was not with convincing Reagan, but Ruckelshaus, who was said to be happy in his work as a senior vice president of the Washington state lumber firm of Weyerhaeuser Co., where he has worked since 1975.

Despite various reports that he might seek public office in Washington, Ruckelshaus has stayed out of the limelight since he resigned from the Nixon administration in October, 1973, rather than fire Watergate Special Prosecutor Archibald Cox in the incident that became known as the "Saturday Night Massacre."

Ruckelshaus' wife, Jill, is known to have questioned whether her husband should give up his life in Seattle to return to political life in the capital.

It was the reluctance of Jill Ruckelshaus, more than any other factor, that caused Ruckelshaus to delay his decision for four days after Reagan called him last week, sources said. The president at the time told Ruckelshaus he was the "ideal man" for the job, and Ruckelshaus thanked him and said he would talk the offer over with his family.

Sources said that Reagan, White House chief of staff James A. Baker III and counselor Edwin Meese III had assured Ruckelshaus that he would have the independence and backing he needed to do the job as EPA administrator. These sources said that this pledge was unanimous in high administration councils, and included Watt.

"Watt knows Ruckelshaus well and considers him to be a strong and effective manager who will be a strong team player," said Watt spokesman Doug Baldwin. "He does not view this with anything but strong enthusiasm."

The president underscored his support of Ruckelshaus yesterday by announcing his nomination in glowing terms in a 15-minute appearance in the White House briefing room.

"No one brings more impressive credentials to this important job than Bill Ruckelshaus," Reagan said. " . . . He is staunchly committed to protecting the nation's air and water and land."

Reagan said he had authorized Ruckelshaus to conduct an agencywide review of the personnel and resources needed at the EPA.

The president said in responding to questions that he had not given EPA officials a mandate to favor business over the environment.

"I think that was a misreading and, as I say, a misunderstanding," Reagan said. "All that I've ever proposed is that we be fair."