"Why Snape Does What He Does" or "Snape: The Anti-Hero"
Two words: Unbreakable Vows
This will be simple and short. I do not quote the books much herein, because I do not want to pull them out and go through them in minute detail. However, you will find each of the points below is supported by the texts.
Snape's Primary Motivations
Snape was in love with Lily Potter in school. From this primary motivation, the rest of this essay stems.
Snape was arrogant and proud, though ostracized by his fellow students and other wizards in general. He also resented the object of his affection, Lily, who saw Snape's repeated humiliation at the hands of his nemesis, James Potter. In Snape's twisted mind, he loved her but he could not stand her to see him bested by James. In short, he did not want pity from her, he wanted adoration.
This undercurrent is apparent in Order of the Phoenix when Harry saw the scene in Snape's Pensieve.
Ultimately, Snape was scorned, hurt and further infuriated by Lily and her subsequent love affair and marriage to the same James Potter.
Snape joined Voldemort in the first War to exorcize these demons: 1.) revenge on James Potter, 2.) revenge on Lily Potter, and perhaps an opportunity to "acquire" Lily as a spoil of War, and 3.) revenge on the Wizarding World.
Snape betrayed James and Lily to their deaths, but not knowing that Voldemort planned to kill the whole family. My view is that Snape thought that Voldemort would kill James, as well as Harry, but let Lily live. Snape tried to make some bargain to this effect before providing Voldemort with the information. There is evidence for this in that Voldemort did not kill Lily outright. Voldemort only killed her when she would not move aside. In contrast, Voldemort killed James outright.
Snape felt no remorse for James' death – any idea that he was remorseful on this count would be completely out of his character. He was, however, absolutely destroyed over Lily's death. He loved her, in his twisted fashion, and her death was two things: 1.) the loss of the only love of his life, and 2.) a betrayal by Voldemort.
Snape's Subsequent Actions
Snape seeks out the only man who can stand against Voldemort; that is, Dumbledore. He throws himself on Dumbledore's mercy and seeks any way for revenge and redemption for killing Lily.
Dumbledore makes Snape swear an unbreakable vow or vows. My feeling is that this vow was twofold: 1.) to do whatever Dumbledore ordered in destroying Voldemort or the Death Eaters, and 2.) to protect Harry.
This is vitally important, because I think that the reason Dumbledore has ABSOLUTE confidence in Snape is because Dumbledore holds Snape's unbreakable vow of obedience. Snape may be an evil and/or completely selfish son of a gun, but Dumbledore feels that he has a completely secure collar on Snape, at least insofar as fighting Voldemort.
Some may try to refute the "protect Harry" vow. But you will notice that any time Snape hurts Harry, it is rarely physical harm. When he does physically harm Harry, it is usually pursuant to a lesson that can help Harry. Even in the climactic sequence at the end of HBP, Snape is telling Harry that Harry's attacks will continue to be blocked unless Harry can grasp the principles behind occlumency – something that will be necessary to defeat Voldemort. When Snape loses his temper in that scene, he does not irretrievably harm Harry, and Harry shakes off the effects of the attack in moments.
Snape's Feelings About Harry
When Harry enters school, it is obvious that Snape actually hates Harry. He does not feel any affection for the boy.
In Snape's mind, he hates Harry for the following reasons: 1.) He looks, acts, and is respected by his peers like James, 2.) He is a constant reminder of Lily (the eyes), 3.) "Harry killed Lily" in Snape's twisted view, i.e. she died for Harry and Snape lost her, and 4.) Snape is now bound to protect (and in OotP forced to help) the object of his loathing, causing further resentment.
This is my view of events:
1.)Snape is bound by an unbreakable vow (as set forth above) to do what Dumbledore orders.
2.)Snape is bound by an unbreakable vow (as set forth above) to protect Harry.
3.)Dumbledore has ordered Snape to do anything to convince the Death Eaters that Snape is Voldemort's man through and through, short of harming Harry.
4.)At the beginning of HBP, pursuant to Dumbledore's orders to gain the confidence of the Death Eaters, Snape makes the unbreakable vow with the Death Eaters to help Draco kill Dumbledore.
5.) Dumbledore knows of Snape's vow to help Draco.
6.)At Dumbledore's death, Snape arrives on the roof and sees Draco flagging in his determination to kill Dumbledore.
7.)At Dumbledore's death, Snape sees two broomsticks on the rooftop and surmises that Harry is with Dumbledore. If Harry is discovered, Harry will be killed.
8.) If Snape intervenes on Dumbledore's behalf, Snape will a.) violate Dumbledore's orders and reveal that Snape is not loyal to Voldemort, thereby breaking Snape's unbreakable vow to Dumbledore, b.) jeopardize Harry's safety, thereby breaking Snape's unbreakable vow to Dumbledore, and c.) allow Draco to fail, thereby breaking Snape's unbreakable vow to the Death Eaters.
So you see, the only choice left to Snape is to kill Dumbledore, given the unbreakable vows in which Snape is caught.
This is supported by the text of HBP. On the rooftop, Dumbledore only becomes fearful when Snape arrives. The reason for this is simple: Dumbledore knows of all of Snape's unbreakable vows. Dumbledore knows that Snape only has the one option.
I also feel that Snape did not regret killing Dumbledore one bit. Snape had no love or loyalty for the old headmaster. Snape had his own agenda the whole time, he resented Dumbledore's control, and he saw himself as superior to Dumbledore.
The moral of this story is that Snape is not a redeeming character. He is twisted and ruthlessly selfish. He was not ever a "good guy," but he was also not evil through and through. He could feel love in his own twisted, possessive and harmful way. He also could do work for the "good guys" but only at the "point of a gun" so to speak.
This makes Snape very interesting. If my suppositions are true, he becomes perhaps the deepest and most well-rounded character in the Harry Potter series.
This leads me to my last point. Snape cannot irretrievably harm Harry, but Harry will need Snape in order to win. You see…Snape has not yet attained his revenge on Voldemort for the death of Lily.
In short, Snape will become the iconic anti-hero.