He does not fit anywhere else. He actually loves Hogwarts in his own way
We see squibs are difficult to find their place in magical world. Though apparently they want to belong. We see Mrs Figg living among muggles, but breeding kneazles to keep her connection with wizards. We also have Ron mentioning his mother's cousin who works as accountant (it is not specifically said he is a squib, but we can assume so giving the Weasleys are one of the most pure-blood families). Apparently he decided to fully mix with muggles and thus was excluded from magical society (as Ron said, now the Weasleys don't even speak of him).
Are all your family wizards?’ asked Harry, who found Ron just as interesting as Ron found him.
‘Er – yes, I think so,’ said Ron. ‘I think Mum’s got a second cousin who’s an accountant, but we never talk about him.
I believe for Filch getting a job in Hogwarts was a big luck. He is very bitter about being a squib and he obviously wants to belong to the wizarding world at least somehow (mind his Kwikspell lessons). Providing him with a job in magical society looks like an act of sympathy (something Dumbledore would do, though we do not know for sure who hired him).
Moreover, I think it's incorrect to claim he hates Hogwarts. He is very bitter indeed, but at the same time he is very devoted to his job and does it the best he can. He is nearly obsessed with keeping the school in order and harassment of the students seems like his way of fulfilling his responsibilities. He is undeniably very loyal to the school, he stays for the Hogwarts battle after all.