If there's a sign that says "Women" on the door, I lock the stall and leave the main unlocked.
On the other hand, if it's a unisex/family bathroom, I lock the door.
One time when I was just brushing my teeth after lunch in such a bathroom where I work, I nearly gave one of my male colleagues a heart attack because I didn't lock the door (hey, who cares if someone comes in while I'm brishing my teeth?) He must have thought I was performing some weird female beauty and/or plumbing ritual because he said, "holy ****! You've gotta lock the door when you're in here!"