WASHINGTON (AP) _ Prison officials cannot isolate inmates to prevent their radical ideas from spreading to other prisoners, according to a federal court ruling.

U.S. District Judge Barrington Parker ordered authorities at the Federal Correctional Institution in Lexington, Ky ., to transfer into the general prison population two women who were held in an isolation unit because of their political beliefs.

''Defendants may be concerned that the two plaintiffs will persuade inmates within the general prison population to share their political views but those fears cannot be accommodated at the expense of constitutional rights,'' Parker wrote in his ruling.

He said ''the designation of prisoners solely for their subversive statements and thoughts is the type of overreaction that the Supreme Court has repeatedly warned against.''

Parker barred the Bureau of Prisons from ''considering a prisoner's past political association or personal political beliefs'' in deciding on transfers within federal prisons.

The ruling came in a lawsuit filed by the American Civil Liberties Union's National Prison Project, the Center for Constitutional Rights, the People's Law Office and private attorneys challenging prison regulations.

It was filed on behalf of three women held in the high-security isolation unit at the Kentucky prison. Lawyers for the women said they had been treated so inhumanely that they might be permanently psychologically harmed.

Parker ordered the Bureau of Prisons to rewrite its regulations and to transfer Silvia Baraldini and Susan Rosenberg, alleged members of leftist political groups, into the general prison population.

He added: ''The treatment of the plaintiffs has skirted elemental standards of human decency. The exaggerated security, small group isolation and staff harassment serve to constantly undermine the inmates' morale.''

A third prisoner represented in the lawsuit, Sylvia Brown, had not been placed in the isolation unit because of her political beliefs and was not covered by transfer order, said the ACLU's Alexa Freeman.

Adjoa Aiyetoro, lead counsel for the prisoners, said the ruling was a ''tremendous victory.''

''The decision vindicates the rights of prisoners to hold beliefs based on conscience,'' she said.

John C. Cleary, who represented the Bureau of Prisons in the lawsuit, declined to comment on the ruling. At a hearing before Parker last month, Cleary argued that the women were transferred into the unit because they posed ''a risk of external assault on the prison.'' He said there was no medical evidence to support claims they had suffered psychological harm.

The bureau has announced plans to close the Lexington unit and transfer prisoners to a new high security unit at Marianna, Fla. Parker warned the bureau to be careful that conditions at the new unit ''do not lead to wanton and unnecessary inflictions of psychological pain.''

Rosenberg is serving a 58-year term for possessing weapons and explosives in connection with a 1985 police raid in New Jersey and is one of seven recently indicted in the 1983 bombing of the U.S. Capitol.

Baraldini was convicted of racketeering and conspiracy in aiding a $1.6 million Brink's armored car heist in Nyack, N.Y., in 1981 in which a guard and two police officers were killed.