It's likely that one of the door locks is faulty (the actual actuator that locks the doors) If the car senses a fault the default position is 'unlocked' - presumably so you're not locked out if it fails completely.
I don't think there's any way to diagnose which one it is - but it's most commonly the driver's door, but it could be any of them, including the boot lock. The boot's the easiest one to get to, so I'd consider swapping that one with one from a breakers, and see if it makes a difference.