Our schools teach us things like the founding fathers were heroic revolutionaries casting off the shackles of monarchy for the benefit of mankind because The U.S. government has to justify its own existence as being somehow intrinsically, morally, or mystically correct. No one wants to think that the government is just a bunch of guys who own the land between canada and mexico, and got it by inciting mob violence and forming armed militias.
(see the Nobel Prize winning Ideological Origins of the American Revolution)
But you can pick any major historical event and look at the basic message that kids are sent: the civil war was about freeing the slaves, WW2 was about saving the jews, vietnam was about stopping communism, Iraq was about deposing a mad dictator with WMD's. Step back from any of these and look at the various motivations of all the players involved and you get a very complex picture that doesn't reduce easily to an ideological byline (America: spreading freedom!). But every country teaches children that it is awesome, otherwise those children might grow up not believing in the legitimacy of the people in power.
In short, the actual function of school is to tell children that the current balance of power is the correct one, and comes up with all manner of reasons why this is so regardless of what the power structure actually is.