I was just thinking how weird it is that most US public schools have their own districts separate from county and municipal governments. Why was this the institutional design chosen instead of running schools like other municipal departments?
Like all branches of American history, there are very few absolutes in education history. Two that relate to your question is that there isn't an American education system, there's 50+ different systems [states, territories, Department of Defense schools, Bureau of Indian Affairs, etc.] and that very little of those modern day systems was designed in the way we think of the word. Instead, adults tried something regarding educating the next generation of children and what didn't work was changed and what did work stuck around and was adopted in other places. Basically, it just kinda happened that way because it worked and was popular.
If we pull back and look at the earliest systems of formal education for white children in this country, the organizing center wasn't necessarily geographical. While there were early efforts to require communities to build schools or hire a schoolmaster if the population reach a certain point (Massachusetts' 1647 Old Deluder Satan Act), towns often ignored it. Meanwhile, communities in other colonies built schoolhouses or established schools in other buildings without any legal impetus. Meanwhile, early schoolmasters often led iterant lives, going where there were parents willing to pay for their son's education. That education was increasingly in service to admission to the Colonial Colleges, such as Harvard. These colleges taught boys as young as 10 and men as old as 35 and typically had no geographical requirement - primarily, students had to be able to pass an admission interview and pay tuition. Numerous schools, such as Boston Latin, were founded to act as feeder schools to places like Harvard, but again, had no geographical requirement. A boy might travel from NYC to Boston, board with a local family friend, prepare for the Harvard entrance exams at Boston Latin and then enroll at Harvard. To be sure, most of the students came the area around the College but that was more a function of limited means of travel than anything else. (Some young men did travel to the early Colonial Colleges, which is one of the factors that led to creation of more. That is, parents in New York City encouraged the founding of King's College (later Columbia) so their sons wouldn't have to travel to Philadelphia.)
As grammar schools for white boys and girls became more common in the early 19th century, it wasn't uncommon for an area to have several schoolhouses that pulled in children from the same community or conversely, one schoolhouse that served children from multiple communities. There was a veritable construction boom during during the rise of common schools and the feminization of the profession prior to the Civil War and slowly, states began to work out consistent funding structures for schools. As I mentioned above, locales tried out different approaches including funding every school that served students - which meant raising public and private funds for schools with explicit religious objectives as well as those with more secular goals (i.e. reading, 'riting, 'rithmatic, and Americana) but it was short-lived. Instead, communities found it more effective, and more popular, to use public dollars - school taxes - for just the secular schools and let parents fund private schools and religious institutions fund religious schools. These funds were generally pooled - a schoolhouse had a budget and that budget was fairly consistent from teaching period to teaching period, typically regardless of student enrollment. (As an aside, one of the arguments that contributed to the feminization of the profession was that women teachers were cheaper than men teachers. A school board could save money by hiring an unmarried woman when the man teacher moved on - as they always did.)
A whole bunch happened at the end of the 19th century, early 20th century that changed how schools were funded. First, and likely most meaningfully, there was a huge population boom that forced a more formal approach to schools and school funding. Most east coast cities established bureaucracies in the mid-1800s but the concept went widespread in this era as school became increasingly something children did and attendance periods went from two 8 to 10 week session a year to upwards of 180 days with small breaks for holidays and a longer summer vacation. A key component was the creation of the school district which were typically organized around town borders but not always - and that "not always" is very important. If, in a region of a state, there's at least one school district whose attendance zone crosses town boundaries and needs to be funded with taxes that are separate from town, village, city, or county taxes, they all need to be. This approach was, in effect, the easiest and most schools - and later districts - were already funded by a separate force as explained above.
So - the gist. Taxes for publics schools were seen as different than municipal departments, and general taxes, as adults were thinking about how to fund education long before how to fund other municipal services and schools (or districts) often cross municipal lines. I've written answers on lots of what I mentioned in this comment and am happy to provide additional context!