Question: Dumbledore, over and over, is demonstrated to be a man who can see through people with all the power of an x-ray machine. Nothing escapes him, there is no fooling him. He *knows*.

So how the heck did Lockhart get in??

Answer: 
[Pottermore](https://www.pottermore.com/writing-by-jk-rowling/gilderoy-lockhart) has the following to say about Lockhart's appointment:

> 
> Albus Dumbledore, the Headmaster during Lockhart's time, happened to have known two of the wizards whose memories Lockhart erased, and had a shrewd and accurate idea what was happening. He correctly believed that dragging Lockhart into a normal, school atmosphere would reveal his fradulence and, a vacancy in Defence Against the Dark Arts having opened up in June 1992, tracked down the author and, .... convinced Lockhart to return to Hogwarts (something Lockhart had not been too keen to do, as many of his teachers were still there and might have remembered his foolishness and ineptitude).
> 
> 
> 

Even the book canon, namely the *Chamber of Secrets* implicitly supports the view that Dumbledore always had known or guessed the full truth about Lockhart. After Harry's explanation of the ordeal in the *Chamber*, he asks:

> 
> “But one of us seems to be keeping mightily quiet about his part in this dangerous adventure,” Dumbledore added. “Why so modest, Gilderoy?”
> 
> 
> 

And on hearing Ron's answer that

> 
> “He tried to do a Memory Charm and the wand backfired,”
> 
> 
> 

he does the following:

> 
> “Dear me,” said Dumbledore, shaking his head, his long silver
>  mustache quivering. “Impaled upon your own sword, Gilderoy!”
> 
> 
> 

It cannot be more clear that Dumbledore really intended the pun on the last words, referring to Lockhart's masterpiece Memory Charms on others, and that he took the predicament as fitting enough.

I suppose it can be reasonably assumed that Harry recognised this full knowledge of Dumbledore as well, for he never explains a word to him. He may have thought to spare Lockhart's image from the public, but Dumbledore is not a man he would have done that with, given Harry's unusual grasp of strategic issues in every situation. In *Order of the Phoenix*, he lets Dumbledore know that "he *was* the snake", for example, something he found hard to contemplate himself, even in front of Sirius. There is nothing *here* that would have prevented him from that. Ron's wand "being in a condition to backfire" is not something which Ron can be implicated for, any more, and even much less, than the opening of the Chamber is for Ginny.
From the books, I recall that people were starting to think that the DADA job was cursed and Dumbledore seemed to be having trouble filling the position.  

He even went as far as hiring Prof. Lupin which was a somewhat dangerous and controversial choice.  

In my opinion, Lupin was a more desperate choice than a charlatan like Lockhart.  

I'm speculating but again, I think this means that the position was hard to fill. Such as, nobody wanted it so he gave it to Lockhart and Lupin.  

Dumbledore was also very perceptive, he must have known something was amiss with Lockhart, but Dumbledore believes in people and decided to give him a chance (as he gave Lupin a chance despite the danger)  

And perhaps Dumbledore figured that over time Lockhart would grow into the job (on the job learning.)