I think it's a balance between how they were raised, and how they were influenced by the media/school.
When kids are in school they're met up with other kids raised by different parents with different views and of course they'll think their parents are the ones who know the only correct answer and will in turn try to impose it on other kids.
The media makes certain groups of people look horrid (fat is BAD. gay is BAD. skinny is GOOD-be skinny! straight is GOOD-look how few problems they are! old is BAD-buy our stuff to be young again! and so on, and so on)
So the poor child ends up with at least 3 incoming opinions and typically (I feel) when at least 2 match up, the child will usually think that's the right one to go with since it won majority. Later they may realize it's wrong and change, or fight it because it's not what they grew up believing was right.
Someday I hope we can end the useless hate of gay, fat, old, etc. and learn to try to work together to fix real problems like gangs, drugs, hunger, war, and sickness...