I attended churches for about 40 or more years. In my experience they were not primarily charitable. They were like tax free social clubs and business groups, where one went to find business opportunities. In my last church we had an extremely minimal charity budget if any, and there was a stink when the latest minister wanted to increase it.
Rather it seems to be argued that simply having people sit in pews and be preached at is worthy of a tax break.
Our church also flirted with a philosophy of racial segregation. We had a speaker come in and explain to us how to increase our membership, one method being to become more uniracial in our composition, because as he put it, most people are uncomfortable worshipping in a diverse setting. This hostility to diversity extended to overt attempts to strong arm members to oppose equal rights for non heterosexuals. One Sunday we were asked to physically stand up in church if we opposed such equality. I was quite uncomfortable and conspicuous sitting as almost the entire congregation stood.
In my opinion, there is very minimal if any charitable benefit to exempting churches from real estate taxes on the enormous buildings and land they occupy in my town, although there is one huge local church that does make its buildings available for an annual book festival, most of the others use them exclusively for the benefit of members events.
Even in the case of members there are often minimal services. E.g. when my mother who lived 300 miles away from me, and was a member of the same church for over 50 years, became unable to drive in her 90's, the church had no program and was uninterested in providing any for assisting its elderly members in everyday activities like shopping.
I have similar reservations about so called non profit institutions. In Boston and Cambridge Mass, e.g., Harvard University owns vast real estate holdings and is one of the wealthiest entities in Boston, but all that real estate they and other universities hold, is a dead loss to the city tax base.
The Mormon church and the Catholic church are also extremely wealthy, and when I lived in Salt Lake it was said the Mormons controlled United airlines. It just seems to me to be another example of tax breaks for the wealthy, with a few trickle down charitable benefits.
There is also the political side. In my state there are some churches where the pastors are explicitly exhorting their congregations to vote for one specific candidate for president, although that is prohibited by the law under which they are tax exempt, as Jack21222 said.
the definition of what constitutes a "profit" is also quite arguable. An entity that has so much excess money it can buy businesses and expensive real estate and pay high salaries, arguably is showing a huge profit. recall that even hollywood movies with enormous grosses are often technically said not to show any "profit" after everyone concerned has received a large payout from the proceeds. it is quite correct that not showing a profit goes hand in hand with not paying tax, but doing that is often a matter of accounting for the great sums of money generated in other ways than calling them "profit".
the tax exemption for churches can also be transferred into a tax deferment for individuals. Governor Romney has a trust set up that ostensibly is to provide a gift to the Mormon church on his death, but in the meantime has the ability to increase on investment income tax free, while it pays him and his wife a steady income, with taxes accruing only on that portion which they withdraw. The principal in the trust is well below what current law would require, and the future trend is such that in fact "next to nothing" will actually be left for the charitable donation according to one expert, after the Romneys have received and spent their withdrawals. Thus in this case, and it is common among high income individuals, the tax exemption of the church functions primarily as a tax deferment scheme for wealthy church members.