There should always be a way to completely lock the cockpit door from inside. If there isn't, the door is only a slowing measure for any determined attacker, not a barrier.
If there are ways in always open the door, these ways will get out to the wrong kind of people.
The question is, what do you think is the most likely event, a pilot locking their colleagues out of a hijacker trying to get in?
Both options do happen, question is, how often and with what result?
Again, any option to disable the deadlocking feature on the inside is reducing the difficulty of taking over controls.