In my experience, well behaved children are also children who have strong loving and respectful attachments to their parents and/or caregivers. By this, I mean respect that goes both ways. Kids whose parents love and support them as individuals who are worthy of respect and consideration tend to treat the world around them the same way: they respect others and seem to accept rules or requests that prescribe specific behaviour at specific times. These children also usually have a strong sense of self confidence and esteem and do not feel the need to either be rebellious for rebellion's sake nor to seek attention for their mis-behaviour.
Now, this is not to say that children who "misbehave" are unloved or have parents who do not respect them. All children will do things adults don't want them to do at one time or another and I firmly believe that a great deal of "bad behaviour" is rooted in the issue that parents often misunderstand children's motivations and/or abilities. Children are not little adults. They do not understand the world the way we do and cannot deal with it in the same way we do. A bored adult is likely able to put up with that boredom for a certain amount of time if he or she must do so (i.e. sitting through a meeting, riding in the car etc..) but a child doesn't have that ability and so often "misbehaves" by crying, getting angry or trying to do something to relieve the boredom. Children are often overwhelmed by their emotions and are unable to express or cope with them effectively without acting out. As adults, we caregivers must recognize the individual traits and abilities of the child, his or her level of development and the various influential factors within the given situation in order to understand how to deal with the behaviour.
We could just label it "bad behaviour" and punish the child and he or she will learn that that type of behaviour is undesirable if they want to avoid further punishment. But if we show empathy and try to reach a mutual solution to the problem, that child will be given a sense that he or she is a valued person who's emotions are respected and valued as well as problem solving tools which will help him or her resolve similar issues should they arise in the future. One approach sets adults against the child, the other works in collaboration to reach understanding and solution.
Having worked with children with extreme behavioural problems, I try to approach the issue of unacceptable or undesirable behaviour with the mantra that "a child causing a problem is a child trying to solve a problem" meaning that a kid acts the way he or she does in order to get something he or she desires. As the caregiver involved, I can either try to find out what that desire focuses on or I can try to simply end the behaviour. I'm not suggesting that you immediately give the child what he or she asks for, in fact many times a child is unable to actually articulate what they are seeking as they are less able to label their emotions and understand the causes of their impulses. What I mean is that by asking myself and the child what the motivating factor might be, I'm able to understand why the behaviour occurred and therefore establish a dialogue about what the child did, why it was inappropriate and what might be done in the future to deal with similar situations. This approach not only establishes an empathetic connection but helps the child understand the situation while retaining a sense of control over their behaviour within the environment.
To me, it's not a matter of raising well behaved kids, it's a question of giving them the benefit of self-esteem, empowerment and the tools necessary to manage their own interactions with the world around them in a favourable and pro-social manner.