We all know the basic set-up for a story: a protagonist wants something, but an antagonist stands in their way and they have to overcome that antagonist to get what they want. The protagonist, by definition, is the character or entity that the story's main focus is on. They're also the character that the reader or viewer is meant to connect with and root for, and most times, that protagonist is the good guy -- but not every time.
It's not hard to root for protagonists like Luke Skywalker, Indiana Jones, and Harry Potter. Those characters have their flaws, but they're inherently good people who want to do the right thing. But what about protagonists like Alex DeLarge or Patrick Bateman, who commit horrific acts left and right with little to no remorse? They would easily be the villains in other stories, and yet we're meant to follow the stories of A Clockwork Orange and American Psycho through their eyes and become fully invested in their side of each tale. How in the world does a writer achieve that?
I should explore first whether or not such a character is still considered a "villain" when placed in the role of protagonist. Being a villain implies being an antagonist, and it's the role of an antagonist to oppose the protagonist. The only kind of character I can think of who can oppose themselves is a character with multiple personalities. Otherwise, if there's no clear hero anywhere else in the story, I would have to say that someone like Alex DeLarge or Patrick Bateman is not a villain. That person is a form of antihero, a main character who lacks some or all of the qualities of a traditional hero. They can certainly still be villainous, though.
So how does a villainous character work as a protagonist? A good way to start is by creating a sense of logic behind what they do. If the protagonist sees a questionable act as a rational or righteous thing to do, then the audience can get behind them to an extent. Patrick Batemen murders homeless people and prostitutes because he's bound by the conformity of society and sees these "nonconformists" as something bad that has to be removed. One of the reasons Ebenezer Scrooge hates Christmas is because he struggled to earn money most of his life and he sees the holidays as a financially wasteful time of year. In today's economy especially, we can kind of see where the latter character is coming from.
Another way of getting an audience on the side of a villainous protagonist, though it can seem trite if not done carefully, is to make the characters who oppose that protagonist even worse by comparison. Did you ever think an audience could remotely feel sorry for Adolf Hitler? The movie Downfall somehow managed to garner that reaction by making Stalin's Red Army even less compassionate and more brutal than the faltering Nazi Party. On a lighter note, the "Jersey Shore" character knockoffs in the TV movie Jersey Shore Shark Attack become somewhat less detestable when the movie pits them against a group of snobby country club kids. Somewhat less.
For me, the way he interacted with his pet snake that made me really start to connect with him. He takes care of it, lets it roam his room and curl up in bed with him, and he's visibly sad when he hears that it died. Audiences can be oddly forgiving of violence against humans in movies because we've become so desensitized to it, but violence against animals is harder for us to accept. The fact that a sadistic teenage criminal has a soft spot for an animal, however uncuddly that animal may be, shows that he's not completely heartless.
Those are just a few tips that I've come across over the years. These obviously aren't the only ways to make a "bad guy" function as a main character, but they're probably the three most fundamental ones. Every writer who takes on the challenge of telling a story from a villainous character's point of view incorporates their own ideas and nuances into the narrative, and when it works, it really works. I personally don't think that there are only a handful of story ideas out there, and with re-defined roles like this being incorporated, I think writers will always come up with one more idea that we haven't seen before.