Here was Brasil's solution in the middle of last century when I resided there.
In rural, agricultural areas the employer provided the housing, the schools and the school supplies for their employees and their employee's family, whether full time or seasonal. The state provided the school teachers, emergency medical care and medical clinics. The housing and the school facilities had to meet prevailing state codes and the employer provided transportation for medical treatment.
The system worked well and Brasil had a higher literacy rate than the US at that time. Brasil's level of medical care was technically inferior to the US, resulting in higher infant mortality rates, but a higher percentage of the population was under routine medical care.
The system had only one, minor irritation. Any invitation from the state to participate in prophylactic medical procedures, such as inoculations and health assessments, was extended and enforced by armed military personnel on an in-your-face, right now, door to door basis.