I dont see why this isnt working.. what shader verison is this compiled to? You wouldn't happen to be using 3.0 are you?
I have had problems with 3.0 with things like this...it changes some things i dont quite understand.
Try doing something else like doing lighting in the world space, see if that gives you correct results.