James R. Otteson has a readable article entitled Adam Smith vs Ayn Rand on Justifying the Free Society where he explains among other things why Smith could see a valuable place for "publick works," including education, in a free society.
Whereas the Randian would raise a principled objection against any kind of state incursion (including in education) on grounds of violation of individual rights, the Smithian is willing to entertain the possibility, but shifts the burden of proof on to the proposer and maintains a high threshold to initiate action.
This is simultaneously a strength of Smith’s position and indicative of a weakness of Rand’s. Smith’s intellectual humility prevents him from believing that he can excogitate rules for human behavior applicable to all times and all places. Instead, like an Aristotelian empirical scientist, he adopts conclusions tentatively but subject to further empirical review. This gives him a reasonable starting point based in observed reality. Yet it also allows for innovation and flexibility, as the dynamics of human society changes.
Let me now conclude with one final point. Recall this famous passage in Smith: “It is not from the benevolence of the butcher, the brewer, or the baker, that we expect our dinner, but from their regard to their own interest. We address ourselves, not to their humanity but to their self-love, and never talk to them of our own necessities but of their advantages” (WN I.ii.2). That sounds rather Randian, does it not? But what Smith saw in market transactions was not selfishness—as many people, both friends and foes of Smith, claim—but respect: it was peers meeting one another and making offers to one another, each of them respecting the other enough to recognize the other’s authority to say “no, thank you” and go elsewhere. What a profound and deep respect it shows others not to impose one’s own will, values, or purposes on them, not to require permission from or beg the mercy of “superiors,” and instead to recognize each person’s moral authority to say “no.”
The political economy Smith endorsed could, therefore, not only be demonstrated empirically to lead to material prosperity and the alleviation of human misery, but it also instantiated and exemplified the morally beautiful equality of individual human freedom.
Otteson invokes a graphic distinction between Planners and Searchers among those assuming responsibility or following ambition in hoping to change the quality and nature of society.
Planners try to impose universal orders; Searchers instead try to find specific problems where they can make marginal, ground-level differences. [...] Searchers get good work done, marginally and gradually improving the world one step at a time.
I believe, the efforts of politicians and political engagement in all kinds of other functions (campaign supporter etc.) are necessary and commendable, if they contribute to the work of the Searchers rather than that of the Planners, to use the terminology of the article mentioned above. In fact, we can not come by the advantages of the Searchers' work unless people start getting seriously involved in politics.
Relatedly, Russ Roberts on How Adam Smith Can Change Your Life: