While Gilderoy Lockhart was a useless buffoon, there's something to be said for the potency of his Memory Charms. He managed to use them so well that he wiped the memory of witches and wizards much more powerful than himself.
However, his lack of knowledge regarding any other facet of
magic made him one of the worst professors the school ever had. The Wizarding World was better off that he lost his memory at the end of Chamber of Secrets. To this day, we're still unsure why Dumbledore ever decided to bring in Lockhart to teach his students (at least in the movies).