Villains should be at least somewhat competent to pose a threat to the heroes. Of course they can't be too competent, lest they outsmart the heroes at every turn and become invincible. But they should be good enough to pose a decent threat.
On the other hand, occasionally you can have a truly incompetent villain. This can be played for laughs, or as a surprise in a serious campaign. Not everybody who turns to a life of crime is a mastermind - realistically many villains are going to mess up and make mistakes. Having one make otherwise inexplicable errors simply due to not being so smart adds a bit of realism to your world.
Transcript
GM: Ben, you can make your entrance now.
Chewbacca: {appearing from behind a rock} Luke! I thought that was you. I'd know that voice anywhere.
C-3PO: Chewbacca! How did you get here?
{Chewbacca wrestles Gonzo into submission}
Chewbacca: This foul dastard waylaid me on Kashyyyk while I was combing the forest for a Life Day tree.
Chewbacca: He shanghaied me to this desolate planet and hobbled me behind that landform. But he didn't reckon with the superior rope gnawing tenacity of a Wookiee.
Luke: Wow, he really is the worst villain we've come across.
Gonzo: Yes! Trust me! The most evil, terrible, and absolutely worst in every way! Bwahahaha!!
C-3PO: Two out of three ain't bad.