Until the early 1970's, Virginia had a policy of surgical sterilization for more than 7,000 mentally retarded people, mostly women. Last year, a California judge ordered a woman convicted of child abuse to use a surgically implanted contraceptive, but the order was widely criticized and the case is being appealed.

The proposal to use castration as a punishment for sex crimes re-emerged in the 1980's in a few scattered cases in which judges offered people convicted of rape or sexual abuse the choice of castration or long prison terms. But those offers were either withdrawn or overruled before any castration took place.

Two years ago, Washington State legislators considered, and finally rejected, two bills on castration. One provided for mandatory castration of certain sex offenders; the other allowed sex offenders to choose castration in exchange for reduced prison sentences. Issue of Coercion

A legal expert said yesterday that there was no clear-cut law on the constitutionality of plea agreements involving castration. "Some people would say that sexuality should not be a subject for plea-bargaining, that it's inherently coercive," said Laurence H. Tribe, a professor of constitutional law at Harvard Law School. "Others would say that plea bargains in general are coercive, and maybe castration is a better deal than life in prison."

He said that if the defendant, the prosecutor and the judge agreed to the plea agreement for castration, no other party would have the legal standing to challenge the agreement.

Castration has been offered as an option to sex offenders in other countries.

"In Denmark, in the 1960's, sex offenders were offered the choice of surgical castration, and my recollection is that about 2,000 castrations were performed," said Marvin Wolfgang, a criminologist at the University of Pennsylvania. "I don't think surgical castration is necessary. In Germany and Italy, they have used anti-androgens, which have been very effective in reducing sex drive."

Anti-androgens to suppress male hormones, a treatment sometimes referred to as chemical castration, have also been used in this country.