I've had a similar problem with the dock -- I move icons around in the order I want them, and 2 seconds later they're back in the original spot. Sometimes I have to move an icon several times before the dock takes the change and stops moving them back.
The problem is that your preferences are not being saved. That would suggest a corrupt plist file in <user>/Library/Preferences.
The Dock plist will be something like "com.apple.Dock.plist" or "com.apple.dockfixup.plist" . Try deleting that and restarting. You may of course then need to set your Dock as you want it (fortunately it left mine intact), and then check that the settings hold after reboot.