From the slang expression have one's head up one's ass, thus, wearing the ass as a hat. The term is extended to people who are clueless or bumbling, who don't understand what is going on.
asshat (plural asshats)
- (Canada, US, pejorative, slang, vulgar) An obnoxiously ignorant person; a fool.
- See also Wikisaurus:idiot