Washington (CNN) -- The Supreme Court has ruled the federal government may not deny funds from its global anti-AIDS program to organizations that refuse to actively oppose prostitution. In a 6-2 decision on Thursday, the justices determined the policy requiring fund recipients adhere to a larger message about fighting disease and its root causes was not directly related to the "core" mandate of the AIDS program. Chief Justice John Roberts, who wrote the opinion for the majority, said the 2003 law violated the First Amendment. The ruling tosses out the policy. The case was closely watched by many U.S.-based non-governmental organizations that distribute financial and other assistance overseas.
@highlight
Law aimed to make reducing HIV/AIDS behavioral risks a priority of prevention
@highlight
U.S. law conditioned funding on pledge to oppose prostitution
@highlight
Chief Justice John Roberts said the policy violated the First Amendment
@highlight
Some groups called the requirement a "loyalty oath"
In addition to promoting abstinence, monogamy, counseling, and the use of condoms, the law sought to use @placeholder funds to "educate men and boys about the risks of procuring sex commercially" as well as finding ways to help "commercial sex workers" themselves get out of the business.