Nexus 5 lock button behaves awkwardly
It is possible that the button itself is damaged.

The button is made of 2 metal foils (one is flat, the other is a bit spherical on top) and if you press it, the sphere bends to the bottom foil and the connection represents a press. On my old Galaxy Nexus, dirt got under and it stopped reacting. Once I opened and cleaned it carefully with a knife it worked as the first day.

Considering you have the opposite problem, it could be the case that the spherical foil is somehow bent to keep sticking to the bottom even when you release the button. 

Since this requires you to open up the device, I suggest this as the last resort unless you ran out of other options. (Or send it in for a repair).