I don't think the law was speaking about sleep at all. It is mostly about looking smart, casual or at least presentable in public.
What personal cleanliness has to do with the police when you are driving is a mystery. You can not like someone else's apparel but how is that offensive or against the law.