An Illinois judge has ruled the state can deny Catholic Charities state funds to run its foster care and adoption services.

The state decided after four decades against renewing contracts with Catholic Charities in Joliet, Peoria, Springfield and Belleville.

Catholic Charities policy turns away openly gay parents.

The issue became heated in June when a civil unions law that recognizes gay and lesbian couples approved last December went into effect. Noting the teachings of the Catholic Church, which defines marriage as a heterosexual union, Catholic Charities told the state that it could not accommodate prospective foster parents in a civil union.

The foster care and adoption agency argued it was exempt from the law under its religious protections clause.

The state, however, argued that the law's religious exemptions only apply to clergy who refuse to officiate at civil unions.

Sangamon County Circuit Judge John Schmidt ruled against Catholic Charities on Thursday.

“No citizen has a recognized legal right to a contract with the government,” he wrote.

But Schmidt's ruling narrowly focused on whether the state violated the property rights of Catholic Charities when it refused to sign new contracts and avoided the religious freedom issue.

Catholic Charities has about 2,200 children in its care. The group said it would likely file an appeal.