Five of the remaining senior officials at the Environmental Protection Agency resigned yesterday, bringing to 13 the number of political appointees who have left the troubled agency since it became the focus of a growing controversy seven weeks ago.

President Reagan maintained that the five left their jobs voluntarily, but one of them, Acting Administrator John W. Hernandez Jr., had strongly urged Reagan to keep him on in some capacity.

During a short news conference in the White House briefing room, Reagan said that the latest resignations have not further tarnished the administration's image on environmental issues.

"I don't think it necessarily looks bad," Reagan said. "Some of these feel there was far more chance of success, of the agency continuing to function, that they can contribute by leaving.

"All of those who implied that this was engineered, no," Reagan said, referring to reports that the White House had quietly arranged yesterday's resignations and the March 9 departure of former administrator Anne M. Burford.

As expected, Hernandez, general counsel Robert M. Perry and John A. Todhunter, assistant administrator for pesticides and toxic substances, resigned effective yesterday. All three have been criticized by congressional committees that are examining allegations of favoritism and conflicts of interest at EPA.

Paul C. Cahill, director of the Office of Federal Activities, also quit his post yesterday, less than two weeks after the resignation of his deputy, Louis J. Cordia. John E. Daniel, who was Burford's chief of staff, also resigned, although he will stay on as a special assistant to help with the transition.

Hernandez' prospects of becoming EPA's permanent administrator vanished last week when Reagan picked William D. Ruckelshaus for the job. Although Hernandez had been criticized widely for allowing Dow Chemical Co. to suggest changes in an EPA report on dioxin contamination, he had still hoped to stay on in some capacity.

In a letter to Reagan last Monday, Hernandez praised the nomination of Ruckelshaus as "a master stroke" that "parallels your own record of environmental accomplishments while governor of California."

"Mr. President, speaking for my self, the greatest honor of my life has been to serve in your administration," he wrote. "That honor can only be enriched by the opportunity to continue to serve you under Bill Ruckelshaus and I will give him my full support."

Hours after he accepted Hernandez' resignation, Reagan told high school students in an interview carried on C-Span Broadcasting:

"Mr. Hernandez was not fired. Mr. Hernandez has been wanting to resign, and I think understandably so, because of all the . . . investigations on the part of congressional committees, and so forth."

At the EPA's offices in Waterside Mall, dozens of career employes found cause for celebration. Staffers in Perry's office were singing songs, drawing cartoons and performing skits. Downstairs in the shopping mall, Harry's Liquor, Wine and Cheese sold eight cases of champagne and six ounces of Russian caviar to the general counsel's office.

"It's the most we've ever sold to the EPA," the store manager said. "They were jubilant." In Cahill's office, former employes were said to be planning to come in from around the country for a party tonight.

The career officials whom Reagan brought from other agencies to shore up the EPA last month moved into temporary leadership positions.

Lee Verstandig, a former assistant secretary of transportation, became the agency's third administrator in 16 days. Lee M. Thomas became acting deputy administrator while continuing to run the hazardous waste cleanup program.

Courtney Price was named acting general counsel, and veteran EPA employe Pasquale A. Alberico took over the Office of Federal Activities.

Reagan told reporters that "with all the allegations and all of the accusations . . . no proof of wrongdoing has been presented in all of this fuss yet." He told the high school students later that recent reporting on the EPA "leaves something to be desired."

"You have to recognize that many of these things were done, such as the toxic waste dumps, at a time when no one was knowingly exposing people to a hazardous substance," he said. "We just didn't understand those things."