Severus was not a mudblood. He was a half blood with a pureblood mother from the Prince line; The Halfblooded Prince.
Lily was a childhood friend of his, a crush, and most likely the bitter man's one true love. He told Lily about magic and she was probably Snape's best friend for most of his (early) life.
When they became estranged later in their Hogwarts career, and Lily became romantically involved with James Potter, Snape developed a bitter resentment. He fell in with the wrong crowd and he joined the Death Eaters, at the height of their power.
When Sibyl Trelawney gave the prophecy1 to Dumbledore at the Hog's Head, Snape was listening at the door, overhearing the first two lines before being caught.
"The one with the power to vanquish the Dark Lord approaches...Born to those who have thrice defied him, born as the seventh month dies..."
This gave Voldemort all he needed to narrow down which two children it could be; Neville Longbottom or Harry Potter.
Once Snape realized that he had caused Voldemort to focus on Lily, James, and baby Harry, he panicked. While he begged for Lily's life, he probably wasn't too concerned about James Potter. Snape confessed to Dumbledore, expressed his remorse, and rejoined the side of the light as a spy for the Order of the Phoenix.
When Harry arrives at Hogwarts a decade later, Snape shows that he hates Harry on principle; Harry looked like a carbon copy of his father, who was Snape's bully.
Harry did have a habit for rule breaking:
- stealing from Snape's stores in the second year
- fighting trolls
- sneaking around with an invisibility cloak
- even allowing Sirius Black to escape once Snape had caught him.
This made it easier for Snape to see more of James in Harry, and less of the intelligent Lily Evans who was a dedicated student.
It should be noted that Snape did watch out for Harry. While he was caustic and deplorable as an educator, he did look after Harry, locking a broom jinx in first year, and all of his acts as a spy in bringing down Voldemort.
Snape was a spy. Most of the Slytherin students were the children of Death Eaters. Like Dumbledore, Snape anticipated the rise of Voldemort as an eventuality. He needed to preserve his position as a spy. Playing nice with Hufflepuffs and especially Gryffindors would have hurt his image, especially with the Death Eater parents.
He portrayed himself as aligned with the dark side because that was his job as a spy. He had years to ingratiate himself with them, even becoming Draco Malfoy's godfather.
So in summary, Snape is so angry with Harry in particular because he is petty in a sense; punishing the son for the sins of a father he never knew. He's ferocious with the other houses and is only nice to his Slytherins because he needs to preserve his role as a spy.