WASHINGTON -- The Supreme Court ruled Monday that a Lakewood baker who refused to make a wedding cake for a same-sex couple because of religious beliefs did not violate Colorado's anti-discrimination law.

But the court is not deciding the big issue in the case, whether a business can invoke religious objections to refuse service to gay and lesbian people.

The justices' limited ruling turned on what the court described as anti-religious bias on the Colorado Civil Rights Commission when it ruled against baker Jack Phillips.

The justices voted 7-2 that the commission violated Phillips' rights under the First Amendment.

RELATED: Supreme Court ruling

Justice Anthony Kennedy said in his majority opinion that the issue "must await further elaboration."

Appeals in similar cases are pending, including one at the Supreme Court from a florist who didn't want to provide flowers for a same-sex wedding.

The same-sex couple at the heart of the case, Charlie Craig and David Mullins, complained to the Colorado commission in 2012 after they visited Phillips' Masterpiece Cakeshop in Lakewood and the baker quickly told them he would not create a cake for a same-sex wedding.

Colorado law prohibits discrimination on the basis of sexual orientation, and the commission concluded that Phillips' refusal violated the law. Colorado state courts upheld the determination.

But when the justices heard arguments in December, Kennedy was plainly bothered by comments by a commission member.

The commissioner seemed "neither tolerant nor respectful of Mr. Phillips' religious beliefs," Kennedy said then.

That same sentiment suffused his opinion on Monday.

"The commission's hostility was inconsistent with the First Amendment's guarantee that our laws be applied in a manner that is neutral toward religion," he wrote.

Liberal justices Stephen Breyer and Elena Kagan joined the conservative justices in the outcome. Kagan wrote separately to emphasize the limited ruling.

Justices Ruth Bader Ginsburg and Sonia Sotomayor dissented.

In a statement issued after the ruling, Phillips' Supreme Court lawyer praised the decision.

"Government hostility toward people of faith has no place in our society, yet the state of Colorado was openly antagonistic toward Jack's religious beliefs about marriage. The court was right to condemn that," said Kristen Waggoner, the Alliance Defending Freedom senior counsel who argued Phillips' case.

Waggoner said Phillips is willing to sell ready-made products to anyone who enters his store. But, "he simply declines to express messages or celebrate events that violate his deeply held beliefs," she said.

The American Civil Liberties Union, which represented the couple in its legal fight, said it was pleased the court did not endorse a broad religion-based exemption from anti-discrimination laws.

"The court reversed the Masterpiece Cakeshop decision based on concerns unique to the case but reaffirmed its longstanding rule that states can prevent the harms of discrimination in the marketplace, including against LGBT people." said Louise Melling, the ACLU's deputy legal director.

Several legal disputes are pending over wedding services, similar to the Phillips case.

Video producers, graphic artists and florists are among business owners who say they oppose same-sex marriage on religious grounds and don't want to participate in same-sex weddings.

Barronelle Stutzman, a florist in Richland, Washington, has appealed a state Supreme Court ruling that found she violated state law for refusing to provide the wedding flowers for two men who were about to be married.

The justices could decide what to do with that appeal by the end of June.