"Only the Transfiguration teacher, Dumbledore, seemed to think Hagrid was innocent. He persuaded Dippet to keep Hagrid and train him as gamekeeper. Yes, I think Dumbledore might have guessed ... Dumbledore never seemed to like me as much as the other teachers did ... he certainly kept an annoyingly close watch on me after Hagrid was expelled."
-- Tom Riddle (CS17)
Hagrid is expelled after being accused of opening the Chamber of Secrets and releasing a monster who killed Myrtle Warren. He was framed for this by Tom Riddle, who saw Hagrid as an easy target for persecution, being oversized and clumsy and unusually fond of dangerous creatures. Tom confronted Hagrid, who was taking care of a baby acromantula in the dungeons, and publicly accused him of opening the Chamber. Hagrid was expelled without further proof on the power of Riddle’s persuasion and favored status with the Headmaster at the time, Armando Dippet. Only Dumbledore suspected Riddle of duplicity but couldn’t prove it.