The state Supreme Court ruled that the work of Catholic Charities and four related organizations is primarily not religious.