The 5-4 decision said forcing the Scouts to accept gay troop leaders would violate the organization's rights of free expression and free association under the Constitution's First Amendment.
"The Boy Scouts asserts that homosexual conduct is inconsistent with the values it seeks to instill," Chief Justice William H. Rehnquist wrote for the court. Requiring them to accept a gay scoutmaster "would significantly burden the organization's right to oppose or disfavor homosexual conduct."
The ruling reversed a New Jersey Supreme Court holding that the Scouts wrongly ousted assistant Scoutmaster James Dale when the organization learned he is gay. The state court had said the scouts' action violated a New Jersey law banning discrimination in public accommodation.
Dale, who was an Eagle Scout, had sued the Scouts under the New Jersey law. But the Supreme Court said Wednesday that law must yield to the Scout organization's right of "expressive association" under the Constitution's First Amendment.
The American Center for Law and Justice, a conservative advocacy group that filed a friend-of-the-court brief supporting the Boy Scouts, said the ruling "will have a dramatic impact on all private organizations--including religious groups--to define their own mission and set their own criteria for leadership."
The Human Rights Campaign, a gay-rights organization, called the ruling a "travesty of justice that may allow large, open membership groups to be above the law and evade state and local nondiscrimination laws."
Rehnquist's opinion was joined by Justices Sandra Day O'Connor, Antonin Scalia, Anthony M. Kennedy, and Clarence Thomas.
Dissenting were Justices John Paul Stevens, David H. Souter, Ruth Bader Ginsburg, and Stephen G. Breyer.
Writing for the four, Stevens said the New Jersey law "does not impose any serious burdens" on the Boy Scouts' goals, "nor does it force [the Boy Scouts] to communicate any message that it does not wish to endorse. New Jersey's law, therefore, abridges no constitutional right of the Boy Scouts."
Dale was 19 and an assistant scoutmaster of a Matawan, N.J., troop when in 1990 he was identified in a newspaper article as co-president of a campus lesbian and gay student group at Rutgers University.
The Scouts' Monmouth Council revoked Dale's registration as an adult leader, telling him the organization does not allow openly gay members. Dale sued, contending the Scouts violated New Jersey's anti-discrimination law.
The New Jersey Supreme Court ruled in his favor, saying the expulsion of Dale was based "on little more than prejudice."
During oral arguments in April, the Scouts' lawyer, George Davidson, said the group had a right "to choose the moral leaders for the children in the program."
The Scouts relied on a 1995 Supreme Court decision in which the justices let the private sponsor of the Boston St. Patrick's Day Parade exclude a group of gays and lesbians, saying parades are a "form of expression."
Dale's lawyer, Evan Wolfson, said giving public accommodations the broad freedom to exclude people who do not match their message could swallow the civil rights laws.
Dale's attorneys cited Supreme Court decisions during the 1980s that let states force the Jaycees and Rotary International to admit women as full members. The court also let New York City bar large private clubs from discriminating against women and minorities.
Rehnquist's opinion said "it appears that homosexuality has gained greater societal acceptance" in recent times.
"But this is scarcely an argument for denying First Amendment protection to those who refuse to accept those views," the chief justice wrote. "The First Amendment protects expression, be it of the popular variety or not."
The Supreme Court has dealt with gay rights infrequently. In 1996, the justices struck down a Colorado measure that barred ordinances giving gays legal protection from discrimination, such as in housing or employment. But the court has also repeatedly turned away challenges to President Clinton's "Don't ask, don't tell" policy on gays in the military.
Dale now lives in New York City and is advertising director for a magazine for people who are HIV-positive.
The case is Boy Scouts of America v. Dale, 99-699.