The Public Health Service yesterday recommended that several groups, including many homosexual men, drug users and Haitians, refrain from giving blood because they have a high risk of getting AIDS, a deadly disease that wipes out the body's immune system.

Doctors fear that AIDS, or Acquired Immune Deficiency Syndrome, may be spreading through blood transfusions, although the cause of the disease is unknown and there is no test for it.

The government issued "prudent and temporary" blood donation guidelines under which centers collecting blood will be asked to to inform donors of the government's recommendation. The American Red Cross, a major national blood collection agency, yesterday issued a brief statement of general support, saying it will "implement" the government's guidelines.

The recommendation goes further than homosexual rights groups wished, but not as far as organizations like the National Hemophiliac Foundation have advocated. The foundation had asked that homosexual men and other high-risk groups be barred from giving blood.

The recommendations represent a compromise by public health experts, who have been debating for months how best to prevent spread of the disease without unnecessarily stigmatizing the risk groups.

"More than 1,100 cases of the syndrome have been reported since June, 1981, and more than 400 of these patients have died," said Dr. Edward N. Brandt Jr., assistant secretary for health. He added that "available information suggests that AIDS is caused by a transmissible agent."

Three-fourths of AIDS victims have been homosexual men, but the disease recently has been found in 11 hemophiliacs who get blood products from thousands of donors and several individuals getting other blood transfusions.

Virginia Apuzzo of the National Gay Task Force expressed dismay over the recommendations. She said blood banks should "screen blood, not people," and said that the guidelines were "blunt and insufficient." The government specified that "sexually active homosexual or bisexual men with multiple sexual partners" refrain from donating blood.

Apuzzo warned that the recommendations may backfire because some homosexual men might feel compelled to give blood because of fear of discrimination in their jobs.

Her group and others urge instead that so-called "surrogate" screening tests be used to help identify individuals who may have the disease, the symptoms of which take months to show up. They cite surveys showing that nearly 90 percent of AIDS victims have positive reactions to antibody tests for the disease hepatitis B.

The Public Health Service recommends that studies should be conducted to test the effectiveness of such tests in detecting AIDS carriers. Blood bank organizations have worried about the practicality and cost of such testing. These groups have been cautious, saying only that questions about a donor's sexual preferences were inappropriate.

National Hemophilia Foundation Director Alan Brownstein said yesterday that he was pleased with the government's effort, but "We would like to see them go further."

The federal recommendations were prepared by the federal Centers for Disease Control, the Food and Drug Administration and the National Institutes of Health. They also suggest that sexual contact "should be avoided with persons known or suspected to have AIDS" and that those in high-risk groups should be "aware that multiple sexual partners increase the probability of developing AIDS."