Many parents, teachers, and others strongly believe that giving sugar to children causes them to be hyperactive. These anecdotes have been tested in scientific trials (Milich, Wolraich, & Lindgrin, 1986; Krummel, Seligson, & Guthrie, 1996), and the results are quite interesting. In double-blind trials where half of children received sugar and the other half received nutrasweet or some other artificial sweetener, parents reported more hyperactivity when they believed their children were receiving sugar - even when they didn't - and reported less hyperactivity when they believed they did not have sugar - even when they did. In other words, the parent's expectations of hyperactivity determined whether they thought they observed hyperactive behaviours, and actual sugar consumption had no effect. It's classic confirmation bias - when we believe something we focus on supporting evidence while ignoring unsupporting evidence.
Perhaps the origin of the sugar --> hyperactivity myth is that children often consume the most sugar at exciting times (a birthday party, going on a special trip, etc.) and these kinds of events illicit hyperactivity no matter what has been consumed. A parent or teacher may assume the sugar is causing the hyperactivity when really it is just the exciting situation. This is the representativeness heuristic - the belief that two phenomena are related because they share a similarity - in this case a similarity in occurring at the same time. This belief is then supported in the future through the confirmation bias.
And in case you are wondering, high levels of testosterone do not cause violence, and low levels of serotonin do not cause depression. These are both implicated (i.e., violent people tend to have higher levels of testosterone and depressed people tend to have lower levels of serotonin) but simply giving someone an injection of testosterone will not make them any more violent, and artificially lowering someone's serotonin levels will not make them depressed. Both are complicated relationships with additional unidentifiable variables that seem to cause both the chemical imbalance and the behavioural change. The truth is, scientists do not truly know what causes almost any complex behavioural pattern. So if someone says a behaviour pattern is all down to just one dietary ingredient, or just one hormone, or just one neurotransmitter keep in mind that what they are saying is a pretty massive simplification, and not a very accurate one.