Churches are tax exempt, not because they are charities or that the government considers religion to be a charitable cause, but because their organizational and financial structure is that of a non-profit agency. Any organization can file under this non-profit status, it has nothing to do with anything the organization does, it's strictly based on how their finances operate.
Tax exemptions in America are set out under s. 501(c)(3) of the Internal Revenue . To be tax-exempt under section 501(c)(3), an organization must be organized and operated exclusively for , which include both religious and charitable work. "Exempt purpose" does not include being a "non-profit agency."