Interesting nuance. Profitable religions have had a history of investing, especially real estate beyond the church properties.
My understanding is that when a religious organization buys and runs property outside the functioning of the church, it has to pay taxes on whatever profits it earns. So the property is not owned directly by the church. There is a corporate entity that manages the property, which includes separate bookeeping for business and tax purposes. If profitable--after taxes are paid--that company can move money back into the church. The business opertations may be subsidizing the collection plate to keep churches open.
But my understanding is limited. This might be a good topic for some investigation journalism.