Definition: To be sensible
Example: Dan had his head screwed on. He wasn’t going to try cliff diving with the rest of his friends.
Have your head screwed on has a number of variations. That poor head can be screwed on:
to your shoulders
There are probably more, but Iddy’s getting dizzy trying them all out.
He hasn’t found a single explanation for the origin of any of the variations. They all sound extremely painful to him.
It shares the same meaning as another idiom, to have a ‘level head‘. It must simply refer to the physical steadfastness of something screwed down tightly and straight. There is no danger of it coming loose. A head that is screwed down is not going to produce crazy ideas.