probably a matter of adjustment. The connecting rods to the inner door "handle" can be adjusted at the door lock end. I suggest you loosen off the rods and try to operate the lock using the key so that it operates independantly of the inside door handle. That will tell you whether the lock itself is OK. Then reconnect the rods and adjust them till it locks/inlocks freely. Make sure the passanger's door is kept unlocked so you don't unintentionally lock yourself out of the car
Edit: The inside door handle mechanism is very fiddly. If it has been removed at some time and not put back exactly right, it will affect the door lock mechanism via the connecting rods.