The web-of-trust argument is good but raises the question of why he said:
I taught him! I thought I knew him!
Snape was —like Slughorn— a potions expert. He would have done potions to the highest level at Hogwarts, under Slughorn's tutoring. There are a few significant considerations to this:
7 years of curricular contact time is not insignificant.
Snape was a Slytherin, the house Slughorn was the head of. The two would have had lots of extra-curricular contact at Hogwarts.
Lily Evans was in Snape's class. His best friend and eventual love interest, it would have been easy to see the growing infatuation between the two in the class. Slughorn may have considered somebody so full of love unable of the highest evils.
All combined, it's possible that Slughorn considered him a generally nice person with the same interests. It's easy to assume those sorts of people are similar to you and are similarly incapable of murder.
Even once Snape joined the Death Eaters, to the right sort of person, just being a Deatheater was a positive thing. Their rise was subtle, under the creeds similar to magic is might, and many magicking families (eg the Blacks) were initially supportive of this. Given Slughorn's investment in Voldemort at Hogwarts, it doesn't seem unlikely that he also supported his wider ethos. It's also possible that Slughorn suffered from confirmation bias, blinding him to Voldemort's lesser crimes.
It wasn't until later that the Death Eaters started committing high crimes in public. It was all around this time that the Ministry prosecutions started and Snape was turned by Dumbledore.
It's also possible that Slughorn didn't know about Snape's stint as a Death Eater until it was all over... By which time Dumbledore had all but labelled him as a hero.
(On Riddle's classmates: they weren't Death Eaters at school when Slughorn saw them... They were a group of Slytherins which is how he would have seen them.)