The spindle is threaded to hold the knobs on, but has flats to operate the lock mechanism and to allow the set screws in the knob to hold the knob securely to the spindle.
If the set screws become lose they will allow the knob to turn without actuating the lock mechanism. If your knob is "slipping" try tightening this screw.
Prolonged use with a lose set screw can damage the spindle. If tightening the set screw does not help, you should be able to buy a new spindle at your local hardware store (not the chain with the 16 year old clerk, find the one with the proprietor who is approximately as old as your home).