The location and the number of lavatories on the 764 have never made sense to me.
The front two lavatories are located between Polaris and PP cabins, and often shared by passengers in both cabins. The waiting are already bad enough without having one being locked.
I don't quite understand how security issue is related locking one of the bathrooms.
I have never experienced the situation of locking for the entire flight as described by the OP on any of aircrafts UA have operated including the upper deck of the 747. I have seen flight crew locked the lavatory for other crew members to use but unlocked it after all the crews had finished using the lavatory..
Head scratching on this one.
.