Real talk here. From my understanding it all boils down to self esteem and bragging rights. Most people constantly want to feel unique and special because of how our Society teaches people about values. Hats and misc items allow for a character customization to some level, thus allowing for "unique" looks for each character. Even though it has nothing to do with gameplay, most of the time, the idea of getting these items to make yourself look different gives them a demand. Unusual are just a result of super high demand and super low supply, making their value increase significantly. The second thing that gives hats value is because hats give a level of status. It feels good having a lot of rare things, even if they are virtual hats. It's all a very consumerist way of thinking, gaining material possessions (in this case not literally material) gives satisfaction and happiness. That's how it got started at least, now people don't think about much more then how to make their hats into more hats.
I understand completely where your coming from because I personally find the whole hatconomny thing ridiculous and used to spend a lot of time trying to figure out why it exists. I personally feel it's grown way out of proportion and it's dumb how it has affected the game so much. I can't say for myself that I don't care about hats of misc items at all, but I can say that the day these hats started changing how people played the game was the day it became too much.