The chairman and vice chairman of the presidential commission on AIDS resigned yesterday, citing infighting and ideological differences on the 13-member advisory panel that they say have made it impossible for them to do their jobs.

White House spokesman Marlin Fitzwater said President Reagan accepted "with deep regret" the resignation of Dr. W. Eugene Mayberry, an endocrinologist and the chief executive officer of the Mayo Clinic, and will replace him as chairman with retired admiral James D. Watkins, a panel member.

The departure of Mayberry and Dr. Woodrow A. Myers Jr. was a severe blow to the commission, appointed as an expression of Reagan's concern about the spread of AIDS.

Since its appointment in July, the panel has been criticized by public health experts and gay-rights activists who charged that it lacks AIDS experts and is floundering in its attempt to advise Reagan on the "medical, legal, ethical, social and economic impact" of AIDS.

Sources said that, on Tuesday, Mayberry told White House chief of staff Howard H. Baker Jr., a friend, that he would be forced to resign unless the White House fired two panel members who he believed were imperiling its work.

The Mayo spokesman who announced Mayberry's resignation seven hours before the White House said Mayberry is "not giving any reasons."

Several hours after Mayberry's announcement, Myers, Indiana health commissioner, told the White House that Mayberry's departure made it impossible for him to stay. Myers, a nationally known public health official, was the commission's only public health expert and only black member.

"I felt that there was no way that anybody else could coalesce this group and make it work efficiently," Myers said, adding that Mayberry provided "a strong commitment to public health and sound medical principles."

"There are strong ideological perspectives, strong personalities and differences in leadership style," Myers said. He added that the commission "did not receive a full degree of support from the administration." A source said Myers was referring to the White House.

The White House said it could not yet comment on Myers' resignation.

Watkins met with Reagan yesterday and, Fitzwater said, plans to devote "full time and energy" to the commission, which is scheduled to make its first report Dec. 7.

Watkins could not be reached for comment. Several panel members said he told them he plans to begin interviewing for a new staff today.

The commission has been without an executive director since last month. Only three of 15 permanent staff members have been hired. And at least one, a Mayo Clinic physician, quit yesterday.

Watkins, 60, former chief of naval operations, telephoned Frank Lilly, a New York geneticist and the panel's only openly gay member, who is considering resigning. Lilly said Watkins asked him to stay and that his decision depends in part on who replaces Mayberry and Myers.

Lilly said that he is willing to give Watkins a chance but that he "may soon come to the conclusion that the commission is useless or damaging and not worth my time." Lilly said he urged Watkins to recommend that the White House appoint prominent scientists or physicians with experience in AIDS.

While several commision members had criticized Mayberry as a poor administrator slow to set priorities, others have said panel infighting precipitated his departure.

Sources said Mayberry told the White House Tuesday that he would resign unless panel members Dr. William B. Walsh and Dr. Cory Servaas were replaced. Sources said Mayberry had complained repeatedly to White House officials that Walsh, founder of Project Hope, an international health-care organization, and Servaas, publisher of the Saturday Evening Post, were undermining his leadership.

Walsh, a prominent Republican, is the uncle of Education Secretary William J. Bennett and has served on several presidential commissions. Servaas, who runs a controversial mobile AIDS-testing van, is a longtime friend of the Reagans.

Walsh denied yesterday that he had tried to undercut Mayberry. "I repeatedly offered my assistance to Dr. Mayberry, whom I have known for many years," he said. "My loyalty and devotion to the president is such that I would do nothing to bring discredit to this commission, regardless of any personal feelings I may have had."

Servaas said, "I don't think I would respond to that rumor. I don't believe that happened."