In Harry Potter, the hiring of Gilderoy Lockhart as Defense Against the Dark Arts teacher seems to be one of the most baffling and confusing decisions Dumbledore ever made. His enormous intelligence and knowledge of magic should have made Lockhart's obvious shortcomings extremely clear to him, but for some reason, he hires him anyway. As with all of these things, there was a good reason for it.
Source:https://www.cbr.com/why-dumbledore-hired-gilderoy-lockhart-harry-potter/