The Blaine Amendments (which failed federally, but are in 34 state constitutions) arose in the mid-to-late 1800's when Catholic immigrants began to increase significantly. In 1869, politicians in NY managed to secure $1.5 million in state money for Catholic schools. This caused a backlash that ended up as Blaine Amendments, prohibiting public money from going to religious schools of any kind.
Catholics started Catholic schools, so they could avoid Protestant teachers. Which in turn caused Protestants to worry about Catholic teachers.
State constitutions don't ban public money for religious schools because they wanted to enshrine freedom of religion, but rather because immigrants were coming into the country and starting schools of the wrong religion. While the amendments target all religions, it ensures that the majority religious sect of a region will dominate the public schools (which is typically Protestant).