Rotation animation isn't fixed on the pivot point
You can either change the pivot point as moonboots suggests, or (if you need the pivot point to stay elsewhere for other reasons) you can 


Add an Empty on the desired axis of rotation


Select the door, then Shift+Select the Empty, and CtrlP Set Parent to Object
Animate the Empty, not the door




(this is a very common procedure for rotating a camera around a scene by using an Empty)