What I learned in US history (my college minor- and it's been a few years, so forgive me if this isn't 100%) was that, after the Constitution was written, Jefferson started making noise about needing an educated population because a) at the time, the US gov't was considered very complicated, and b) citizens needed to be able to think critically in order to vote properly.
Then, Hamilton set up the first Bank of the United States- printing nationwide currency that was tied to the price of gold, rather than individual banks just issuing "notes" for the gold in vault. This was considered a very complex banking system, as well. So the idea was that if we had this complicated gov't and complicated banking system, and we expected people to fully participate in public life, we needed educated citizens.
From there, it took awhile to give the mandate, but eventually what happened was that during westward expansion, when we set up the national grid (Jefferson again), a schoolhouse had to built where the corners of four quarter sections touched. This was about one schoolhouse per four farms, depending on the size of the farms. The schools went to eighth grade, tops, often not even that far. High school usually cost $$$, and to go you had to board somewhere in town. Hence the stereotype of rural, uneducated rubes- if you lived in town, housing wasn't an issue, and secondary ed was a lot more doable. Unless your parents were very prosperous, if you lived on a farm, there was a good chance that high school was out of the question.
Then, when westward expansion pushed further with the building of the transcontinental railroad (a joint public/private venture), a certain # of lots along the RR tracks were sold to fund a schoolhouse "per settlement requirements". This is where much of the legacy of local control comes from.
Shortly before the Civil War, much of the American SE still had not built or pursued any kind of public education, despite Federal mandates. The Fed was breathing down the necks of the southern states to spend $$$ on public education, and this was one of many minor issues the South had per states rights.
That's all I can remember right now. HTH