Why do viewers like TV and movie protagonists who do bad things? For instance, Walter White from Breaking Bad, or Tony Soprano. Recent research at the University of Buffalo sheds some light on the matter and can be useful for anybody writing fiction.
Who the audience meets first plays a role.
Science Daily reports that heroes were judged to be more heroic when they appeared after a villain and villains were judged to be more villainous when they appeared after a hero.
It's all relative
Lead researcher Matthew Grizzard said, "What's happening here is that we're not making isolated judgments about these characters using some objective standard of morality. We're constantly making comparisons about these characters and the forces they face."
That applies to Walter White, who gradually does worse and worse things--but he's also up against even worse people.
The show's creator, Vince Gilligan, has said he expected the audience to turn on Walter, but most of them stayed loyal to him. A friend of mine who has discussed the show with a lot of people told me that they split into either the Walter camp or the Jesse camp.
A LITTLE GOOD GOES A LONG WAY (FOR THE BAD GUY)
Another interesting finding is that villains get more credit for any altruistic actions they perform than heroes do. If you want to make our villain character more three-dimensional, having them perform even a minor good act will help you achieve that.
(You'll find lots of useful information about creating great characters in my book, Your Writing Coach, available from Amazon or our other favorite bookseller.)