The Warlock is the ideological counterpart to the Paladin. Where paladins strive to wipe out evil wherever they see it, warlocks enslave those evils and use them for their own purposes. Being a warlock is all about harnessing the most wicked, corrupting, and evil forces in the universe.
Why are these forces evil, you ask? Aren't magical powers neutral in themselves depending on how you use them? Isn't killing with one weapon more or less the same as killing with another? Well, if you consider that a warrior basically cuts or bashes things, and a paladin cuts or bashes and brings down the righteous energy of justice. But a warlock uses curses and spells, which, like horrifying biological weapons of modern days, destroy his enemies' minds and eat away their bodies from the inside; wreaks massive havoc with great explosions and persisting fire; and sucks the souls out of people and creatures and uses them to power even more horrifying abilities, such as summoning demonic creatures who would just as soon pluck out your eyeballs as look at you.
To suffer at the hands of a warlock is significantly more excruciating than the attacks of any other class -- a slow, painful, torturous, agonizing death. If warlocks existed in modern earth, their abilities would be against all international agreements on human rights and rules of warfare; they would be squarely in the evil company of terrorism, drug-trafficking, slavery, and biological germ warfare development.
And yet if your warlock works for the Alliance or the Horde, he or she claims to do all of these things all for the greater good.
First, a bit of history
Warlock magic is relatively new to Azeroth, although it is a bit older or the Horde than the Alliance. Although Warlock magic was first developed by the eredar, the orcs were the first race in the game to learn the ways of demonic magic, when Gul'dan became corrupted by the Burning Legion and set their race to the destruction of the draenei. Soon after, when the orcs entered Azeroth through the Dark Portal, they used these powers to great effect against the humans, no doubt making some mages secretly wish they could use those powers too.
After the Horde lost the Second War, however, no doubt a few humans and elves tried to learn demonic magic from their new captives. At that time, they would have kept it very secret, but as time progressed and the chaos of the Third War broke loose, this demonic knowledge became more and more widespread among races without a strong racial sense of distaste and distrust towards these things. The gnomes were probably more captivated by all the new magics warlocks could teach, without realizing how very evil the demonic powers were at first. The blood elves simply became more open about their demonic studies once their nation had been ravaged by the Scourge and they were forced to turn towards some amount of demonic energies to sustain themselves anyways. And the Forsaken probably have the temperament most suited toward warlock magic, as many of them are former humans and elves whose sense of emotion and morality has been distorted or largely removed.
No matter which race you choose, unless you're an orc, warlock magic isn't something you would have grown up with -- on the contrary, if you belong to one of the older races your character would have grown up as a mage, priest, shaman or something and only discovered the ways of the warlock later on, within the last 15 or 20 years or so. If you are a young human warlock, you might have been going through puberty when one of your parents started uncovering the secrets of this magic from the orcs and accidentally allowed you to witness its power.
So the big question is: are all warlocks evil? Certainly, if you want to be evil, the Warlock is the class for you -- feel free to cackle madly and destroy things with wild abandon. If you're undead you can even eat your enemies after you agonize them to death.
But remember, you are part of either the Alliance or the Horde. You must walk in their cities, buy from their auctions, and fight foes alongside other characters in your faction. In many places, it would not be wise to go around broadcasting that you are a warlock, as there are many people who detest everything warlocks stand for. If you are indeed an evil warlock -- perhaps some sort of spy for the Burning Legion, or maybe just a free agent of mayhem -- it might be wise to have some sort of cover story for your character to hide what you really are. "Warlock? No! I'm a mage who just happens to know a lot of fire and shadow spells." Or, if someone catches you with your demon out, you might claim that as a warlock, you "control" these forces of evil without doing anything evil yourself. Someone who doesn't know the extent to which warlock magic not only destroys but tortures as well might just believe it.
Do two evils make a good?
On the other hand, if you're like me, you want to play a warlock because the game mechanics of the class itself look pretty fun, but you don't like roleplaying evil characters so much. For my warlock character, I reinterpreted some of the spells and abilities in my own way, so that, as far as I'm concerned at least, my character doesn't feel so much "evil" as "morally ambiguous."
She claims that when she takes a Soul Shard, for instance, she's not actually capturing someone's soul, but rather some little portion of that person's soul or mind: all their memories before the age of 8, their awareness of the color teal, or perhaps even just a single word from that person's vocabulary (so that they would never again be able to speak, hear, or think about "massage" for instance, although "back rub" would still make sense). To me that's a lot more creative than just stealing someone's soul, and it makes more sense in the case of creatures such as constructs or zombies that don't necessarily have souls; my character can take away a construct's programming for violent actions, or a zombie's constant hunger for brains, and then use these to power her spells.
And speaking of spells, my character would say that just because "Curse of Agony" sounds really bad, doesn't mean it actually is. She says it's the kind of pain that feels really bad at the time, but after healing seems as though it never happened, and besides, it's really no worse than being eviscerated or mind-flayed. There are lots of nasty attacks other classes can do, she would argue, so why do warlocks get all the bad rep? Summoning demons isn't so bad if you keep them under control, right? (By the way, remember that the warlock class is the only one with pets that can talk: use the Pet Emote addon to make the best use of these demon minions as characters to compliment your own. If they merely follow you around without saying anything interesting, you're missing out on a lot of good roleplay opportunities.)
Of course the question of how you want to play your character is entirely up to you. You could go with the straightforward "using evil powers for good purposes" routine, or you could mix it up in whatever way seems to make most sense.