Some relationship between government and religious organizations is inevitable," the court wrote.