Surely murder should've carried a term in Azkaban, or a juvenile prison if one exists in the wizarding world. How could he have been allowed to be gamekeeper in the very school he murdered someone? His name was not cleared until 1992.
Hagrid was not accused of murder.
Though Hagrid was actually innocent, the accusations against him were not of murder, or any other intentional crime, but of accidentally letting a creature he kept kill a student.
“Riddle stepped closer.
‘It’s all over,’ he said. ‘I’m going to have to turn you in, Rubeus. They’re talking about closing Hogwarts if the attacks don’t stop.’
‘What d’yeh –’
‘I don’t think you meant to kill anyone. But monsters don’t make good pets. I suppose you just let it out for exercise and –’
‘It never killed no one!’ said the large boy, backing against the closed door. From behind him, Harry could hear a funny rustling and clicking.”
- Harry Potter and the Chamber of Secrets, Chapter 13 (The Very Secret Diary)
The Acromantula, Aragog, was the one actually blamed for the death of the student.
“I!’ said Aragog, clicking angrily. ‘I was not born in the castle. I come from a distant land. A traveller gave me to Hagrid when I was an egg. Hagrid was only a boy, but he cared for me, hidden in a cupboard in the castle, feeding me on scraps from the table. Hagrid is my good friend, and a good man. When I was discovered, and blamed for the death of a girl, he protected me. I have lived here in the Forest ever since, where Hagrid still visits me.”
- Harry Potter and the Chamber of Secrets, Chapter 15 (Aragog)
As the accusations against Hagrid were of causing a fatal accident to occur, not of murder, and he was underage at the time, it was presumably considered fair to punish him for the incident without a sentence in Azkaban.