"It takes a village" is, I believe, short for a common saying, "It takes a village to raise a child" meaning children are best raised in an environment where more than just the parents are involved. A supportive community (teachers, other parents, friends, family) all contribute to raise a child.
I have also heard it used in a more negative context. "It takes a village" could also mean that for every person that is guilty of some crime or bad act, others could be involved or at least could be supportive of that bad act.