Snape has an interesting internal code of ethics. Most of what he does, IMO, is out of guilt over his past actions as a Death Eater, or some weird sense of... hatred/gratitude/obligation to James. And he's trying to live up to Dumbledore's trust and expectations.
Of course I'm not sure that Dumbledore is the kindly old man we see him as. Some of his actions are definitely manipulative and I no longer trust him. His interests aren't to keep Harry alive; he wants Voldemort dead. I think he might be willing to sacrifice Harry for that.
Dumbledore is not as obvious about it, but with you I have to wonder just what he is about.
I guess I am too used to Tolkien's method of story telling. Seeing the HP through only one set of eyes is very frustrating at times.