Argus Filch seems to be singularly unsuited as Hogwarts caretaker.
He's not good at either his real job (cleaning up), being a Squib and thus unable to deal with any and all magical messes - never mind dealing with Peeves' ones; or his self-appointed job (discipline), given all the stuff students get by him.
He's also not exactly a good staff fit for a school run by Albus Dumbldore (what with his insatiable thirst for medieval torture of students for minor offenses).
Why exactly did Dumbledore keep him around and not replace with someone better at his job?
I'm looking for book canon/JKR answers.