Don't discriminate. Revoke the tax-exempt status of ALL churches . . . Make non-profits pay the same real estate taxes as everyone else, so that the free market can actually work to put underused properties to their best use.
Speaking about U.S. non-profits the bright line is "personal inurement" and I think that is a good place for it to say. http://www.irs.gov/charities/nonprofits/article/0,,id=169403,00.html The government is therefore not placed in a position to say whether donating shoes to Africa or teaching computer skills in Dallas are more valuable. It just has to determine whether the activity results in individuals diverting untaxed income to their personal benefit. The government is also not put in a position of deciding whether atheists, spaghetti-monster-believers, or Mormons are more valuable to the communities where they exist.
Thus if the Church of Scientology loses a tax case it is because it has not respected personal inurement rules (or the related principle that donations must be gratuitous).
The U.S. system has the advantage of content-neutral enforcement but financial transparency. I would choose this result even if it means that non-profits I don't value or agree with get the benefits of the system. BTW, the rules for joint ventures and investment for non-profits are so restrictive, that some health care providers are converting from non-profits when they can. It's not a free-ride by any means.