Why were public schools established?

In the late 18th century, the American government declared that schools were public, so that all kids could go to school. The early schools were opened to teach kids about the Bible.