To what extent, and even if, tax exemptions should be given to religious organizations and churches depends on why tax exemptions exist in the first place. If you think tax exemptions exist because charitable organizations provide a public benefit, you may be suspicious of according such an exemption to churches. If you think tax exemptions exist because charitable organizations simply have no net income, then churches will naturally qualify.
This question is complicated by the fact that tax exemption is not a single thing but rather a bundle of related things. Organizations which are tax-exempt may receive exemptions not only from federal incomes taxes but also from social security taxes, federal unemployment insurance, sales taxes, excise taxes, and property taxes. An organizations status as tax-exempt also includes the question of tax deductions on: charitable bequests from federal inheritance taxes, charitable gifts from gift taxes, charitable contributions from the donors income taxes.
The idea that tax exemptions are accorded to certain organizations because they provide a benefit to society which the government is unable or unwilling to provide has a long history in the United States. In the 1861 Supreme Court case Perin v. Carey, the Court held that It has now become an established principle of American law that courts of chancery will sustain and protect ...a gift ...to public charitable uses, provided the same is consistent with local laws and public policy...
Later, in 1877 in Ould v. Washington Hospital for Foundlings, the Supreme Court held that A charitable use, where neither law nor public policy forbids, may be applied to almost any thing that tends to promote the well-doing and well-being of social man. Thus, the exact nature or purpose of a charitable organization remains open and variable, but one constant remains which unites the class: the general benefit of the public and society.
Also of relevance is the idea that the goals and actions of a charitable organization reflect, or at least not contradict, public policy. This gained increased prominence in the Supreme Court decision in Bob Jones University vs. United States when the tax-exempt status of Bob Jones University was revoked because of their racial discrimination. Many are under the impression that this was a new development, but as can be seen above it has been a part of constitutional jurisprudence since at least 1861, and probably a part of legal thinking for much longer.