Make them legally split into two entities - one that does the religious stuff and one that does the charitable stuff. The latter is a non-profit and can be treated like any other charity. The former should be taxed like any other corporation. The religious side can of course donate to the non-profit and get the accompanying tax break for charitable donation if it wants, but then that funding has to be used for charitable purposes.
Make them legally split into two entities - one that does the religious stuff and one that does the charitable stuff. The latter is a non-profit and can be treated like any other charity. The former should be taxed like any other corporation. The religious side can of course donate to the non-profit and get the accompanying tax break for charitable donation if it wants, but then that funding has to be used for charitable purposes.