Children's shows shouldn't be all about violence by any means, but having a brainless show that's sunshine and rainbows isn't good either. I'm also talking about shows (except those for really young viewers) that portray bad guys as never actually doing any harm at all, and everything always ends up as sunshine and rainbows anyhow, so it really doesn't matter. With small children, of course this doesn't apply. I'm speaking about when kids start to be more aware of the world, and of themselves. Teaching children how to deal with situations when bad things happen is important. That's partially why my parent's (as well as plenty others I'm sure) got us a dog - dogs are wonderful, but they die, and that's sad - and you deal with it, correctly. Kid shows should be fun to watch and for the most part not too heavy, but I think there should be obstacles for the main characters, and problems to solve caused by the villain(s).
Characters like 'Swiper' from Dora the explorer should always be implemented in cartoons for children. Not only does it show that there can always be a bad side to things, but it shows that life is not always a cheesy magical land where nothing wrong happens. Cartoons nowadays have been avoiding this concept...
For every good and worthwhile story, there is a worthwhile antagonist. While it is key to show children that there is good in the world around them, it is also important that children understand the unfortunate fact that there are bad people in the world. Children should be taught who to look out for, and who to trust, and allowing a bad guy on children's shows can teach them about good and evil in a simple way.
By the time children know enough language that their parents should be letting them watch TV, they know what's real and what isn't. Those that don't know by then will never learn. Things that conflict reality should even emphasize that divide, since children have common sense from an early age. Producers can make silly comedy relief bad guys or exaggerated hammy bad guys to give children even more of the entertainment that bad guys give.