Education Secretary William J. Bennett, in his first official advice on what children should be taught about AIDS, yesterday urged the nation's schools to emphasize moral lessons of sexual restraint as the most effective way of avoiding the disease.

He also stressed that young people should be taught that condoms can fail to prevent transmission of AIDS and argued that "promoting the use of condoms can suggest to teen-agers that adults expect them to engage in sexual intercourse."

Bennett's advice, contained in a guidebook on AIDS education released by the Department of Education, reflects the division within the Reagan administration on acquired immune deficiency syndrome. While Surgeon General C. Everett Koop has also promoted abstinence, he has urged that condoms be used by sexually active people to reduce the risk of AIDS. Bennett advocates an AIDS-prevention strategy based on teaching teen-agers that sexual activity other than in a monogamous, adult relationship is immoral.

"We cannot shy away from associating moral values with behavior," Bennett said at a news conference. "This handbook affirms that, in the education of the young, moral instruction is a key ally in the effort to protect their well-being."

Education Department officials said a half-million copies of the 28-page book of guidelines for schools and parents, "AIDS and the Education of our Children," will be distributed. They will go to every school principal, board of education and parents' organization in the country.

While the Department of Education guidelines are not binding, they are the only guidance so far from federal education officials to states and local communities, which have been wrestling with how to teach about AIDS. Bennett said the department has been flooded with requests for advice on the subject.

Release of the book prompted immediate negative reaction from gay-rights groups and others disturbed that the guidelines make no recommendation that schools teach sexually active children how to avoid the disease.

"There is a higher morality than the one Secretary Bennett is putting forward and that is saving children's lives," said Jeffrey Levi, executive director of the National Lesbian and Gay Task Force. "If we allow our fears about sex to interfere with information about AIDS prevention, we are going to be sacrificing too many lives."

Rep. Ted Weiss (D-N.Y.) said the book is "totally out of touch with reality" because it spent "90 percent of its time talking about abstinence when a chart {in the book} shows that by the age of 19, more than 70 percent of teen-agers have had sex."

The National School Boards Association praised the report for dealing "forthrightly" with "the overpowering moral dimension" of AIDS prevention.

The book does not spell out what information schools should give students at different grades, saying that such decisions should be made at the local level. But it indicates that information about AIDS and how it is spread could be included in sex-education classes usually taught beginning in the seventh grade. Koop has argued that lessons on AIDS should begin as early as the third grade.

On the issue of whether students with AIDS should attend school, the booklet advises districts to "take into consideration bona fide medical considerations about the likelihood of the risk of the infection to other children" and said restrictions may be justified. It also prints the Public Health Service recommendation that most children with AIDS be allowed to attend school.

In stressing the risks of condoms as prevention, Bennett said those who previously have promoted the use of condoms are "admitting either to overstatement or mistake." Koop was out of the country yesterday but a spokesman for the surgeon general, James Brown, said Koop had not revised his position on condom effectiveness, but may do so after a new study on the issue is complete.