First, what kind of game are you wanting to play? The villian of a game rife with horror is going to be very, very different than a game that focuses on political intrigue. How much mystery do you want in the game? How big is the game? That is, an epic game is going to be very different than a smaller focused story.
Second, what do you want this bad guy to achieve? I usually come up with the major conflict of the story first before I start thinking about bad guys. Do I want to destroy the world, or just kill all boys with blue eyes? These are important questions to ask yourself!
Third, how do you want your bad guy to be meaningful to the characters? How personal do you want the relationship between villian and player? How meaningful do you want your characters to be to the villian? These are two different questions! Also, how important do you want your characters to be to the story? Are they the heroes of prophecy, or people in the wrong place at the wrong time?
Finally, is this villian going to be the BBEG or a smaller villian? I've been assuming that you're making the BBEG, but I use a similiar method for all of my minior villians.
Once I have all of these quesitons answered, I'm usually well on the way to my perfect villian. After doing some brainstorming of the perfect person to achieve all of the above, I'll write out a backstory and personality sketch of the villian. It's important to know where the villian is starting and where you want it to end up.
Let me give you a few examples.
My dearest darlingest baby, Murder of Crows, has lots of bad guys. It is an epic campaign that is very familiar and comfortable with darkness.
It's BBEG? Well, it has a lot, but one of the main ones is the world's devil, Raiquen. With him, I've run into a major challenge. He's so much above and beyond the world, so much bigger than the characters themselves. How can you make such a creature intimate enough to be feared, but still retain his power and awesome? I've done a few things. I made one of the PCs a devil worshipper at the beginning (he was the first story arch's hidden villian), then let him be redeemed. He knows how horrible the devil is and he's happy to tell any who wants to listen about it. Secondly, I've made the devil get pesonal with the party. He's adopted one of them as his daughter. He teleported her favorite adopted family to her for her birthday, then showed up for a creepy tea and cake. Finally, I make liberal use of cut scenes. This allows me to show the devil in his natural habitat and lets people see how creepy he is when not observed by the party. Also? Foreshadows events quite nicely. In the end, subtlety is your friend.
Of course, not all of your bad guys are going to be so... removed. Sometimes, you want a personal touch, whether it's creating a demon worshipping stalker who wants nothing more than to torture and flay his beloved so he can sew her a wedding dress made from her skin for her to wear in her own personal eternal afterlife that's just him and her, or merely the character's best friend who has been happily plotting their downfall since they were kids. You know, your choice.
I hope this has been a little helpful. Remember, you want to make sure that your players love to hate your bad guy, or they get tiresome. Acheive that and you'll get a villian that's worth fighting against.
PS: When in doubt, kill children. I do.