So, by the time of TNG, war, poverty, hunger, and all that jazz have been eradicated.
Well they still have jazz.
And while Humans might not engage each other in war on the surface of the Earth, warfare is ocassionally visited upon Humans by others who travel to Earth. For the most part the killing and destruction has moved off world. How convenient.
Would education be free? It's never mention one way or the other on the show. Starfleet Academy training would come in exchange for agreeing to time in service. Wesley's ship board education, and Jake's home schooling would come from being dependants of Starfleet personnel. Part of the contract.
Keiko briefly opperated a school on DS9, but any financial arrangements were unseen.