Well now we know you have keyless, likely Freddy's answer seems the most logical, as it is possible for the car to relock the doors after unlocking, if doors are not opened. Why the back door is designed to catch you out, i do not know.
MORAL: Don't leave your 'keyless fob' in car, if you are out of car
(PS....that re-locking by itself happens on both systems 'keyless' type and 'press button key fob' type, as its for anti-theft if you have unlocked the doors and not got in the car, they relock after a set time period)
Note also with keyless fob, if you and your partner both have keyless fobs in the car it a same time, it can cause confusion, for example if you both walk away from the car and the wife has left handbag with keyless fob in car, the car will not lock the doors. A very confusing system
I prefer my Zetec's (base trim model) with simple remote fob where you press buttons on the fob. Its not that hard to press a button