The problem is is that the switch that tells the convienience module (which controls the central locking) whether the door is open or not appears to be stuck and is permanantly telling it that the door is open. Your car has more sense than to lock itself with the drivers door open and will ignore that command from the key. The fact that the car responds in some way when you press the unlock button means that the key is correctly coded to the car.
Similar issues can happen with the infamous rear wash wipe pipe splitting and drowning the micro swith in the boot which can mean the alarm going off randomly, the boot not locking / alarm not arming etc etc. PITA.......... I'm not saying this is your problem here at all, its just another common mk4 problem......