The caveat, somewhat, is that good teachers (true scotsmen) can be closer to a parental and positive influence on a child than a stupid or abusive parent almost exclusively because the (good) teacher is not stupid and abusive.
There's a glaring "no true scotsman" fallacy in my logic above, but my point is that stupid and abusive creates its own opportunity for improvement. My vicarious and anecdotal experience seems to bear this out (but having said that, my vicarious and anecdotal experience comes through teachers who are dedicated, experienced, and committed to the outcomes of the children, which is rarer than it should be).
There's no escaping the trauma of bad parents, but the ability to present the opportunity for a brighter future can help immeasurably. Hope. It can be better than it is.
If anything, peers have been shown to be more influential on beliefs than parents.
And it's a pretty terrible bureaucracy no matter what your perspective may be. It's rife with failure in the noteworthy aspects where it is overly-rigid, and equally so in the areas where no rules or regulations exist. Large parts of it are given to Goodhart's Law, so the results aren't actually as one would hope for them to be, erstwhile it alienates many children in various ways, pressing them into a perpetual ennui, anxieties fit only for consenting adults, social isolation, undesired social exposure, and at the end of it all it's quite probable due to many factors, they will walk away just as vacuous as they would have been if they were pressed through some much more comfortable alternative.
The glum reality of it all is, is that it is little more than the facade, and mostly it serves the purpose of childcare these days.
But more importantly your insipid comment that, God forbid, someone actually give the child some basis for moral structure is itself precisely what I mean to communicate when I speak of the deference - throughout my attainment I was never once given any meaningful education on ethics, or civics, on value or right and wrong. It was rule and law, but never the Rule of Law. And that does not make an upright person. And science does little to inform morality, and droll literature did little to inform us of the myriad moral conundrums inexorably a part of real life. Just because you disagree with it does not make it wrong, that is arrogance.
I would say that I was fortunate to have an upstanding parental figure who fought against all odds to raise me singlehandedly and did so with the most couth methods imaginable - hard and ceaseless labor - but unfortunately I'm in an arena where civility we're so won't to brag about exists only as shibboleth, and I and my like have to dance with backbiting vipers who are more than willing to use uncouth methods to gate or otherwise swallow whole anyone who has some sense of dignity, fairness, accountability, or empathy. And they do so from the bastions of these monolithic bureaucracies hidden behind gilded titles and moats of texts and rules and laws - fictions. But by God maybe if we had teachers willing to step out of the relativistic framework, institutions that respected thousand-year old proven frameworks, even just a human ecology class - by God maybe there wouldn't be so many snakes in the system. And it's not some isolated incident, I can point to highly visible instances like the GFC or the recent congressional insider trading debacle or the countless instances of corporate misbehavior... Because nobody "indoctrinated" the shitheels at the helm of these catastrophic fuckups.