It's been well addressed that Snape was somewhat of an awkward kid with amazing potion-brewing abilities. Here's my take on why his hair was so greasy:
In Deathly Hallows, chapter 33, "The Prince's Tale," we get to see all of Snape's (important) memories, all the way back to when he was a child. The first description of him we get from these earliest memories isn't very pleasant:
"His black hair was overlong and his clothes were so mismatched that it looked deliberate: too short jeans, a shabby, overlarge coat that might have belonged to a grown man, an odd smocklike shirt."
Honestly, if I heard that without knowing it was about Snape, it would sound like the description was referring to a Weasley! Hand-me-downs from varying sources sounds like Snape's family was very poor. He had very little control over the quality of his clothing. They probably didn't have any money for anything to help his hair as a child.
Moving on to his teenage years, I doubt the family found any extra money still. Snape has been developing his potion skills, and he would definitely know how to fix his hair. My guess is he tried it once or twice, but of course it would wear off after a time. He most likely didn't have much money for so many ingredients as to keep a constant supply of hair-helping potion. He had plenty of practice with potion making though, which would mean he probably had access to the Hogwarts potion ingredients room, but I doubt he would have been able to take the ingredients for that much personal use of hair keeping. Therefore, he kept his greasy hair for his teenage years.
Fast forward to when he holds a steady job as the Hogwarts potions teacher, with enough money to do what he wants and all of the ingredients in his office. Even though he had it all accessible to him, why would he? The love of his life Lily was dead, which looking at his past was the only noble thing he cared about (the only thing else he cared about was the Dark Arts and I don't think getting rid of greasy hair is on the top of that list). He did not care for what his students thought about his hair, because he of course could intimidate them through his position as teacher; naturally he was very rude to most students and fixing his greasy hair wouldn't change how the students viewed him.
So basically, the only reason I can think he would fix his greasy hair would be for Lily, and the only time he had the resources to do so was after she was gone. He had no reason to as a teacher and no ability to as a child.