The prohibition of prayer in the Public Schools began with a Supreme Court ruling in 1947.
However, what I find questionable is why the Supreme Court can rule on the conduct of the Public School system since Congress has no power to legislate Public Schools.
The answer is because of another unconstitutional action of Congress; funding Public Schools. If the Federal government provides funding, guidance, and influence then prayer can be interpreted as an attempt to establish a religion by an agenda driven Supreme Court and Congress.
At this time (1787), each colony/state had their own laws about office-holders and religious requirements (the only exception was VA, and they were in the middle of writing theirs). Some required a belief in God, but some were more restrictive and written to prevent Catholics and/or Jews from holding office. 1A was really a states' rights issue. And, those restrictive laws were repealed in fairly short order.