The Virginia Supreme Court revoked a lesbian mother's custody of her 3-year-old son today, citing the "moral climate" in her home and the "social condemnation" the boy would face outside it because of his mother's sexual orientation.

In a bitterly divided 4 to 3 ruling, the state's highest court overturned a lower court and ordered that Tyler Doustou be brought up by his maternal grandmother, who has waged a two-year legal battle to take the toddler from her daughter.

The decision places Virginia at the center of an emotionally explosive legal conflict growing across the country, as more homosexual Americans choose to bring up children openly. State courts have rendered starkly different judgments on the rights of homosexual parents in recent years, and the U.S. Supreme Court so far has not ruled on the issue.

Many conservatives argue that children growing up in such households are doomed to an abnormal upbringing that will leave them confused about morality, female and male roles and their own sexuality. Gay rights advocates adamantly dispute that, saying most of the children grow up well-adjusted and are no more likely to be homosexual than any others.

The case of Kay Bottoms vs. Sharon Bottoms has crystalized the broader struggle and has been fodder for the national talk show circuit. Groups on both sides have watched closely for the outcome. The situation has been all the more compelling because, unlike many court fights that pit one parent against another, the Bottoms case involved a third party -- the boy's grandmother.

Today's decision could have broad implications for parents in Virginia. The court ruled that although homosexuality alone is no reason to take children from their parents, it can be considered an important factor in custody battles.

"We have previously said that living daily under conditions stemming from active lesbianism practiced in the home may impose a burden upon a child by reason of the social condemnation' attached to such an arrangement," Justice A. Christian Compton wrote for the majority. "We do not retreat from that statement; such a result is likely under these facts."

Compton tried to play down the issue of homosexuality in his opinion, choosing to highlight instead other allegations of Sharon Bottoms's unfitness as a mother, such as her spotty employment history and her past promiscuity with men, and her admission that she once hit Tyler hard enough to leave marks.

The chances of any reversal are slim. Lawyers representing Sharon Bottoms said they would ask for a rehearing, but they acknowledged that the odds are against them. They could then petition the U.S. Supreme Court. Federal judges, however, traditionally stay out of the family law arena, preferring to leave it to the states.

How many U.S. children are growing up with homosexual parents is a matter of guesswork. A 1993 U.S. Census survey identified 131,000 households with children younger than 15 living with adult same-sex partners. Gay rights groups estimate there are 8 million to 10 million children living with gay parents.

Their legal status varies dramatically, depending on their state. "There's a huge range," said Nancy D. Polikoff, a law professor at American University who specializes in family issues. "Everything from a small number of states that make it virtually impossible for a lesbian or gay parent to retain custody . . . to a number of states where . . . it's just not a factor at all."

According to the National Center for Lesbian Rights, the highest courts in eight states have ruled that homosexuality is not reason to automatically deny custody, and those in five states have ruled that it is.

The District forbids discrimination against gay parents by law. The Maryland Court of Special Appeals ruled last fall in favor of a gay father's bid for unrestricted visitation of his children, but it sidestepped a broader ruling.

Kay Bottoms, 44, who has had custody of Tyler during the appeal, told a Fredericksburg, Va., radio station that other factors besides lesbianism made her daughter a bad mother. "She neglected this baby a lot," the Associated Press quoted Kay Bottoms as saying. "I didn't fight her just because she turned lesbian."

Sharon Bottoms, 25, did not return phone calls, but April Wade, her live-in lover, told the Associated Press that lawyers had urged them not to comment. "There's a lot of anger, and we don't want to say anything that could be taken wrong," she said.

The American Civil Liberties Union, which has represented Sharon Bottoms, denounced the decision as irrational and based on secondary allegations that never were substantiated. "This is 1995," said Donald K. Butler, a lawyer retained by the ACLU. "None of the prejudices people have against gay and lesbian parents have any basis whatsoever." Richard R. Ryder, who represents Kay Bottoms, said the decision affirms the morality of the traditional heterosexual family. "If you live in Virginia and you engage in lesbian or homosexual behavior in front of a child, you're going to lose the child," he said.

Sharon Bottoms, who lives in Henrico County outside Richmond, conceived Tyler with a man she married at 19 and later divorced. In 1992, she moved in with Wade, 29. Though they hugged, kissed, patted each other on the bottom and slept in the same bed in front of the boy, Sharon Bottoms denied that they engaged in sexual activity in his presence. Wade has become a parent figure whom Tyler calls "Da Da," court papers say. Kay Bottoms sued for custody and won at the local level in 1993 when a judge declared that Sharon Bottoms's "illegal" and "immoral" sexual conduct rendered her an unfit parent. The Virginia Court of Appeals unanimously overturned that decision last June.