It's there to lock the column so the steering wheel can't turn without a key in the ignition. One of the early attempts to thwart thieves and make the insurance companies happy. Maybe if they hadn't opened that can of worms we wouldn't be paying $20K+ for a new car now.
You must be talking about a floorshift car. It is the government way of making sure that the car is in Park (Reverse in a stick car) before you can remove the key. It keeps accidents like the car rolling away from happening.