Yes, but there could be some reason that he had to do that we don't know yet, but in the end he's still on their side.
I mean, at the End Harry finally says that now that he doesnt have any adult parent-like figure worrying about him (aka: James, Lily, Dumbledore, Sirius are all gone) he can go off and defeat Voldemort. It gives him a reason to leave school and therefore move on to bigger and more important things. So perhaps Snape knew he had to kill Dumbledore in order to give Harry the strength to defeat Voldemort...
Look at this quote:
Spoiler:
"And Harry saw very clearly as he sat there under the hot sun how people who cared about him had stood in front of him one by one, his mother, his father, his godfather, and finally Dumbledore, all determined to protect him; but now that was over. He could not let anybody else stand between him and Voldemort; he must abandon forever the illusion he ought to have lost at the age of one, that the shelter of a parent's arms meant that nothing could hurt him. There was no waking from this nightmare, no comforting whisper in the dark that he was safe really, that it was all in his imagination; the last and greatest of his protectors had died, and he was more along than he had ever been before." (p.645)
Now that his final protector (Dumbledore) has died, Harry is alone and only alone can he truely be strong enough to defeat Voldemort. He has to go on alone, and he could not do that until he no longer had the protection of Dumbledore and the others. I think his death was eminent and necessary to the continuation and completion of the series.