Your usage of indoctrination in a neutral context bothered me, so I checked Wikipedia. It turned out that socialization is the positive term referring exactly to what you note important in the modern schools, while indoctrination is seen as a negative activity. This is not to attack your point in any way - only to clear the air about the terminology.
By requiring certain classes, especially in the humanities, schools help to expose students to ways of thought and ideas that are in line with society
This is, sadly, what it may come down to in hands of a less than benevolent government. One might argue that exposition to, say, philosophy classes might broaden a student's perspective and perception of the world, which might lead to a more thoughtful living, and the more people life thoughtfully - regarding their impact on Earth, the society, the culture, the people around them etc. - the better society is, overall. Philosophy is, very basically, a set of ideas about the world, and finding one's best set is an important goal, if only because it allows one to understand their way of living better, which leads to more informed - which often means "better" - choices.
I agree with you on that socialization is very important for a child, and it would take extra effort to find a source of it while being homeschooled, while attending a school gives you that for free. I also agree on that schools - public schools, at least - often provide a heterogenous environment in which a child will learn a lot more about how the world works than if they attended a homogenous, thinly-representing environment.
However, speaking from experience, I'll say that schools don't always provide the socialization one needs or could use most, if at all. I had practically zero social skills before I was... what, 20? Helicopter parenting didn't help, nor did the low culture that so often comes with low income (many kids, including those in my class, were from the poorer neighbourhood across the road from my house). I had barely any socialization with my classmates due to various factors (including the sheer vast divide in interests, level of curiosity and intelligence between most of us), and because I was very socially anxious, I wouldn't attend any extra groups or events.
My point being - different people require different attitudes. I didn't need encouragement to learn all the stuff they've been giving me - I were already soaking it in like a sponge and doing most well on the tests - what I needed was encouragement and information on how to deal with people, and there was no one to give me that. It only started to pile up - discombobulatingly quickly and stressfully - after the first uni try, after a few failed relationships and dealing with people in a different, non-forced way. I'm still nowhere near the level that seems to be expected of me, socially, and I'm not sure I'll ever be because of the vicious circle of social interactions: me being anxious leads to less interactions leads to more anxiety and no gain in skills leads to... Perhaps, then, school is not the only way to socialize, no matter the scale.