In a children's book, this sort of thing is really necessary to an extent, as part of the goal of any good book for children should be to instill virtues. Otherwise, it's all cows on farms going moo-moo. There should be clear heroes who should do clearly good things, and evil jerks who act like evil jerks, so that children can learn the difference between what is valued and what is deplored in society.
In the Harry Potter series, Dolores Umbridge is, for a time, an interesting character in that while she is cruel and heartless, she actually has nothing to do with the Big Bad of the series. Rather, she comes in with the Ministry of Magic, the primary Government institution for Wizards, and is supposed to represent the alleged good. Unlike most of the Death Eaters --- who are either in it for the Evulz or who believe in a kind of Nietzschean ubermensh ethics whereby their power as a wizard grants them right to assert their own rules --- Umbridge honestly believes that she is doing what is good. She believes that she is helping the students by teaching them discipline and to trust the Ministry of Magic - the good guys, that is.
There is a persistent theme in Harry Potter, arguably one of its better ones, that the Government's help isn't worth the loss of freedom it's printed on. Right in the beginning of Chamber of Secrets the Ministry starts bungling things bad. In Goblet of Fire, we learn about Barty Crouch; Crouch is trying to destroy the Death Eaters and is actively opposing Voldemort, yet resorts to tactics of law enforcement that leave a little bit of ambiguity as to whether he can really be called good.
Dolores probably represents the height of this. She is a loyal follower of Cornelius Fudge who appears on his behalf as the new DADA instructor, in part to keep an eye on Harry and Dumbledore. The latter she believes to be rebellious and trying to undermine the Ministry, while the former, Harry, she thinks just has histrionic disorder. She wants for the children to stop believing in the lies that are frightening them, and her goal really is just to keep everyone calm. To ensure this, Umbridge keeps enforcing more and more legislation and acts of the Ministry to give her more and more disciplinary power. Her biggest fault, really, is probably being an idiot. Apart from that, she's a self-righteous do-gooder who can't keep her nose out of everyone's business. She wants discipline, but more so she wants obedience.
I've had plenty of teachers like her. In American public school, they're ubiquitous. I had one teacher in Spanish who gave us a vocabulary quiz on irregular verbs. It was a list of English infinitives, and we had to write down the equivalent Spanish infinitive that corresponded to an irregular verb when conjugated in the 1st person present indicative. One of them was "to know". In Spanish, there are two verbs for this, conocer and saber, both of which are irregular in the first person, both of which translate as "to know". So I wrote down both. She took off points for me doing that, and when I asked her why, she said that conocer wasn't on the study list she gave us; it's an irregular Spanish verb meaning "to know", but the quiz was about her study list of Spanish verbs and not Spanish, so I have to lose points. I've had plenty of teachers like McGonagall and Lupin and Sprout, sure, and none like Snape, but definitely lots of Umbridges, too.
In the Order of the Phoenix where we first encounter Umbridge, there is a scene between Harry and Sirius that I think is supposed to explain her character and open up the story for a deeper development of moral themes. Dolores has just forced Harry to write over and over and over again that he will not tell lies, which scratches the words in blood upon the back of his hand. But also, Harry's lightning bolt scar has been hurting more and more, and Dumbledore has not been around to consult about it. Desperate for someone to speak to, Harry write to Sirius, asking for some advice.
When Sirius shows up in the fire of the Gryffindor common room, this is the conversation that he and Harry have, about his scar hurting and about Umbridge:
"Well, now he's back it's bound to hurt more often," said Sirius.This statement by Sirius is meant to broaden our perspective on the nature of evil. It isn't just black-robed evil murderer types, but there is also a more subtle cruelty of knights templar protecting us from our own selves. Dolores might be terrible as a Death Eater, but she's nothing like them.
"So you don't think it had anything to do with Umbridge touching me when I was in detention with her?" Harry asked.
"I doubt it," said Sirius. "I know her by reputation and I'm sure she's no Death Eater---"
"She's foul enough to be one," said Harry darkly and Ron and Hermione nodded vigorously in agreement.
"Yes, but the world isn't split into good people and Death Eaters," said Sirius with a wry smile. "I know she's a nasty piece of work, though --- you should hear Remus talk about her."
Except that... well... she is a Death Eater.
This might be one of the worst failures of the series. Despite Sirius' claims, the world of Harry Potter is literally split in to good people and Death Eaters, and even the character meant to explicitly contradict this, is, in fact, in league with the Death Eaters.
At the moment it's cool and trendy to have "grey" morality in stories, to make sure there is no one good or evil side. Works like Lord of the Rings or Narnia that do feature clear good and evil get a lot of criticism for it. I think it is definitely interesting when a book shows things from the villain's perspective, or gives the villain actual motives, or even good motives. But I have no problem with books that don't. I like books with clear good and evil just as much as I like books with ambiguous factions. I certainly don't hate books just because they have black/white morality.
It is one, thing, however, to have simple black/white morality. It is another to have black/white morality and explicitly criticize black/white morality, to introduce characters to break the mold of black/white morality, and to still cave in to black/white morality anyway.
Every single villainous character in the entire series, from start to finish, is in league with Voldemort. Even when it makes no sense or isn't necessary.
For instance, consider Draco and the allegiance of House Slytherin to Voldemort. Draco is introduced in the beginning to just be a bully and a spoiled rich brat. There's no reason he has to have anything to do with Voldemort or blood purity for his character to be effective. He can be mean and cruel and be in Ravenclaw. As it turns out, Draco is in league with the Death Eaters and later becomes a Death Eater, and as it turns out House Slytherin is in league with the Death Eaters and later almost completely takes Voldemort's side in the battle at Hogwarts. Turns out the school bullies in the clique at Slytherin are black robed wizards of evil.
There are good people (Harry and Gryffindor House) and Death Eaters (Draco and Slytherin House).
Dolores Umbridge, of course, is the main example here. Dolores is allied to the Ministry and is meant to actually represent a faction fighting Voldemort. Her purpose is to show how even that can be bad. Yet we learn of her history of blood prejudice (a Death Eater trait) in the 5th book, which very quickly lumps her in with Draco, Slytherin, Voldemort, and every single other bad guy in the book.
And when Umbridge wishes to organize an Inquisatorial Squad to keep order in the hallways, she doesn't select people like Percy, goody-two-shoes who love order and discipline as much as herself. Rather, guess who she picks. Yep, she picks Draco, the other villain, despite the fact that Draco's dad actually works for Voldemort (who she supposedly opposes) and that Draco is mostly a troublemaker who causes fights.
The unity between Umbridge and Draco is bizarre. The two share almost nothing in common, really, besides that both are enemies of Harry Potter. And so that is my point, really; every enemy of Harry Potter is a Death Eater, everyone who opposes him ends up, in the end, supporting Voldemort, even people from completely disparate factions.
So now Umbridge, a cruel disciplinarian, and Draco, a troublemaking bully, have joined forces to torment Harry Potter, and it is around this time that Sirius assures us that the world isn't divided in to good people and Death Eaters.
Later, after the fall of the Ministry, Umbridge is seen organizing the Muggle-Born Registration Committee, enforcing blood-purity laws. In this capacity she directly works with several Death Eaters such as Yaxley and Travers, doing their work for them. There's no direct statement that Dolores is in Voldemort's ring of followers, but even if she never puts on a scull mask, it's clear that she's with them. She supports Voldemort and his followers when he's in power, she does his bidding to suppress muggles, she works hand-in-hand with the Death Eaters. She does everything they do, with as much cruelty, and in the same organizations, along with them.
So Dolores is in league with Draco who is in league with Slytherin who is in league with the Death Eaters who are in league with Voldemort. All of the bad guys make one big group, versus Harry Potter. They're all together. Anyone not a good person, no matter what their sympathies or allegiance, in the end, is actually a Death Eater.
Again, this wouldn't be a problem if she didn't make it a problem. Rowling pointed out that there is more to good and evil than Death Eater/not-Death Eater. Then, I guess, forgot, and made all the bad guys Death Eaters. Rowling is the one who made separate factions of bad guys, then Rowling is the one who collapsed all of the factions into a single one.
So, there you go. Despite what Sirius says, actually the world of Harry Potter is split up, into good people, and Death Eaters, depending on how you get along with Harry.