The executive director of a gay rights group says the Justice Department is "finally catching up with legal reality" by declaring that anti-discrimination laws extend to federal employees with the AIDS virus.

An opinion issued Thursday by the Office of Legal Counsel concludes that the federal Rehabilitation Act - which protects the handicapped in the federal workforce or in programs receiving federal aid - also applies to employees with the AIDS virus.The opinion is in line with a Supreme Court ruling last year and the Civil Rights Restoration Act of 1987 passed by Congress.

The Justice Department is "finally catching up with legal reality," said Jeff Levi, executive director of the National Gay and Lesbian Task Force. Many state handicapped laws have already been changed to protect people infected with AIDS.

In view of the Supreme Court opinion and other court rulings, the Justice Department's revised position is "a little late in coming; in fact it's a lot late in coming," said David Barr, staff attorney for the Lambda Legal Defense and Education Fund.

The opinion says that those with the AIDS virus in whom the disease has progressed can be excluded from the workplace if they pose a threat to the health or safety of others or are unable to do their job.

Since the available medical information shows that the risk of infection being transmitted in the normal course of the workplace is very low, an AIDS-infected employee "by and large . . . should be treated like any other employee," Assistant Attorney General Douglas Kmiec, head of the Office of Legal Counsel, told a news conference.

Kmiec said an AIDS-infected employee "should be assessed for his ability to do the job like anyone else."

The legal opinion differs sharply from an opinion his predecessor, Charles Cooper, issued in June 1986, that employers may discriminate against victims of contagious diseases such as AIDS based on an irrational fear of contagion.

The Supreme Court rejected that argument last year, extending the protection of the federal Rehabilitation Act to people handicapped by contagious disease, including AIDS.

The legal opinion adheres to President Reagan's statement of last August in which he said that federal employers should treat those infected with the AIDS virus like any other employees, as long as they don't pose health and safety dangers or performance problems.