The comment from "English Teacher" is correct. This is an idiom meaning that a person lacks common sense. To understand this idiom, imagine that a person's head is attached to his body like a screw - if his head is "screwed on backwards," then he is facing his backside and therefore, unable to see either what is ahead of him or what he is doing.
Example usage: "Even after making a shopping list, he still forgot to buy beef for the stew - it was as though his head was screwed on backwards."