The Law of Tax Exempt Organizations (Wiley) by Bruce Hopkins has a solid and brief treatment of the history of tax
exemption and cites several more detailed sources.
Tax exempt status was granted in the original legislation enacting the income tax after the ratification of the
Sixteenth Amendment in 1913, which permitted the federal income tax. The concept of tax exemption for charitable,
religious and educational institutions dates back even further. (Hopkins does not provide information on the origins
of section 501(c)(3) specifically.)
For example, the Tariff Act of 1984 (section 32) provided exemption from the two percent corporate tax for nonprofiit
charitable, religious, and educational organizations.