Have you ever told a lie? Had a drink before you were legally allowed to do it? Taken something that wasn't yours? Did it make you a completely evil person? Have you ever met a completely bad person?
So why would you write a character that way? If you're writing in black and white, you're not writing at your best. The world, and every person in it, is filled with shades of grey.
Good vs. Evil
Novels often pit a hero, a good guy, against a villain, a bad guy. This is the oldest literary plot device, the most basic foundation of many stories, and there's no reason you can't use it in your novels. Just remember not to get too literal about it. Rarely are people all bad, so inherently evil that they have no spark of human kindness or compassion, guilt or regret, anywhere inside them. Writing a villain that's totally evil is going to make that villain feel two-dimensional, a caricature rather than a character.
But you can get away with it. Villains are supposed to be bad, and writing a really bad one can make your story that much more thrilling. The argument can even be made that people who are nothing but evil have existed in the real world. Some have said this about people like Charles Manson and Adolph Hilter. But you aren't going to find a person in the real world who is all goodness, and you'd better not present me with a character who is.
We all have flaws, and we all want to read about characters who are flawed, too. Why is that? Because in your story, if the character who is all good defeats the character who is all evil, that's great. But it's not going to be relatable to me in any way, because I'm not all good and I know it. I make mistakes. I fall down. I say the wrong things. I eat that third piece of cake when no one's looking. What are the odds that I want to read about a character who never screws up, never falls down, never fails and does only good things?
You guessed it: zero. Readers root for heroes the hardest when they can see bits and pieces of themselves in those heroes. It's much easier to cheer for a guy who's a little bit shy and unsure of himself, a guy who gets tongue-tied in front of the pretty girl, rather than the guy who does everything right and knows just what to say every single time. It makes the hero's triumph much more satisfying when the hero overcomes not only the villain, but his or her own flaws and failings.
And sometimes, villains aren't really evil people. They might be at odds with the hero, sure, but in their version of the story, the villain is the hero. They're the main character of their own story, and they have their own motivations for doing all their "evil" deeds. What are those motivations? Everyone's done wrong things in their lives, told those little lies, cheated on that test, all that stuff. Make your villains three-dimensional and real. Make them human. And make them relatable, too.
All your characters should feel like real people, and real people don't come in shades of black and white...so don't write them that way.