At the time of the writing of the constitution, 12 of the 13 colonies had SPECIFIC laws on the religious requirements for officeholders. They ranged from the mild (belief in God) to the specific (belief in the Trinity) and kept out Catholics, Jews, Anabaptists, atheists, etc., in their respective states. The First Amendment was specifically written to protect the states from the feds telling them that they CAN'T continue with religious barriers.
So, it was really enacted to ensure the mixing of state and church, the opposite of what we're taught in school. And, in case you're curious, Virginia was the only state w/o the requirement, but they were on their way to getting one in place. And, Massachusetts was the last state to get rid of these laws (1831, I believe).
Indeed, the First Amendment was intended to protect state establishments of religion from any federal interference, but judicial activists "evolved" our "living, breathing" Constitution to make it mean the exact opposite.