Reading the Harry Potter series, I have this feeling that Dumbledore always got the Defense Against the Dark Arts teacher wrong. Was this on purpose or was it his incompetence?
It depends on what you mean by "wrong".
- Quirrell was already a Hogwarts instructor, the Professor of Muggle Studies, and was known to be brilliant in Theoretical Dark Arts Defense (After all, Voldemort is dead, it's all theory anyhow).
- Lockhart was the Brian Williams of the wizarding world... no one had any idea that he actually hadn't done any of the things he said he did.
- There was nothing wrong with Lupin - He controlled his Lycanthropy with a Wolfsbane potion, and only forgot due to the Scabbers incident. While being known and respected, and wasn't a danger to himself, or others, but the wizarding world as a whole dislikes werewolves, and so the prejudice kicked him out.
- Alastar Moody is a famous Auror, known far and wide for dedication against the dark arts. Think of him like a Pre-politics John McCain. The fact he was a Death Eater in a war hero suit was unknown until the very last minute.
- Umbridge was not a decision by Dumbledore, but rather the corrupted Ministry of Magic.
- There's nothing wrong with Snape as a DaDA teacher... He actually wanted the position, and since Slughorn took over potions, it was a natural fit. He even taught Harry Occlumency, over and above his normal teaching.
- The Carrows were put in place by Voldy himself, as the former headmaster was Dumble-dead.
Sometimes it was out of his control, in other times it was depending on circumstance.
For example, in book 1, Quirrell was the teacher. He was a teacher in the past but because Voldemort (who cursed the DADA post so no one would last more than 3 terms) was possessing Quirrell, he was able to stay longer than others.
In book 2, Lockhart is the teacher. This is because no one else wants the post, not because Dumbledore wanted him in particular. We also learn that the job is essentially cursed.
"He was the on' man for the job," said Hagrid, offering them a Y plate of treacle fudge, while Ron coughed squelchily into his basin. "An' I mean the on' one. Gettin' very difficult ter find anyone fer Y the Dark Arts job. People aren't too keen ter take it on, see. They're startin' ter think it's jinxed. No one's lasted long fer a while now. -Chamber of Secrets
In book 3, chances are looking slim for a teacher, but Lupin (a werewolf who people are reluctant to employ) gets a chance by Dumbledore to teach. He was by peer judgement a very good teacher (approved by Madam Pomfrey, students, and teachers).
In book 4, the Triwizard Tournament takes place, and as Sirius points out that Dumbledore is reading the signs, gets Mad eye Moody to take the post, just for 1 year (pointed out to be an teacher experienced in his field even though he turned out to be Barty Crouch Junior and placed illegal curses on his students)
If it hurts again, go straight to Dumbledore they're saying he's got MadEye out of retirement, which means he's reading the signs, even if no one else is. Goblet of Fire
In book 5, it is in the same position as Book 2. No one wants the job, with the public considering it cursed, however, this time the ministry intervenes and force Dumbledore to employ a ministry witch (Umbridge) in essence to spy and cause trouble at Hogwarts.
In book 6, Dumbledore needed Slughorn in order to obtain a memory, and as Slughorn taught potions, Snape had to move to the vacant role he so longed for (DADA). Dumbledore also knew he was going to die, so he gave Snape his wish at teaching DADA knowing that he would play a larger role when Dumbledore goes in the school anyway (technically Snape didn't last longer than 3 months either, he left before the end of the last term, and came back as a headteacher).
In book 7, Dumbledore was inactive due to being in the afterlife. Not his fault!
As seen in this question and answers the position was cursed by Voldemort. Dumbledore was not incompetent... he would have to search very hard and long just to find a teacher willing to accept the position.