An "economy" is defined as "the wealth and resources of a region". This can be simplified to a "market". Simply put, an economy is a "market". TF2 does in fact have a market. Every item has a price that depends on supply and demand. Hats are rarer and in more demand than weapons.

You don't have to agree with it. You might just want to play the game without having to worry about trading and item prices. That's fine—no one is forcing you to trade. The item drop system will randomly drop you weapons and occasionally hats.

"Why would people pay real life money for virtual hats?", you may ask. "They serve no real-life purpose!" Diamonds serve no real-life purpose, either. People will pay big bucks for diamonds. The same principle applies here. Diamonds serve to decorate your real-life body. Hats in TF2 serve to decorate your virtual body.

"Traders drive the prices of things up!", you may say. This is not necessarily true. Supply and demand drives the prices of things up. Keys are in fairly high supply but extraordinarily high demand. This means that the price of keys hovers at around 2.55 refined. Earbuds are in fairly low supply but very hgih demand. This means that earbuds are rather expensive—around 25 keys.

"I don't care about trading, I just want to play TF2 and I want hats! Trading should have never existed!" This argument makes no sense. Trading makes acquiring hats even easier. Prior to the Mann-conomy update in 2010, the only way to acquire hats was to craft excess weapons into scrap metal, then craft 3 scrap metal into 1 reclaimed metal, then craft 3 reclaimed metal into 1 refined metal, then craft 3 refined metal into 1 random hat. Now, you can just join a trade server and buy a craftable hat for around 1 refined to 1 refined + 1 reclaimed. As a bonus, you know exactly what hat you will get when you purchase, as opposed to the random crafting system. The old craft-3-refined method still works, by the way.

"Tour of Duty Tickets cost $0.99, and keys cost $2.49, and yet tickets are worth a key? Why?!" Tickets are a fairly new item. Keys have been around for a very long time. Therefore, the supply of tickets is low, and the demand is high. The supply of keys is high, and the demand is lower. This causes the price of tickets to rise. (The price difference isn't all that great, really, you can easily get keys for $1.30 on the "black market").

TL;DR TF2 has an economy, whether you like it or not. People who pay real-life money for TF2 hats are no more insane than people who buy real-life diamond rings. The TF2 economy can benefit all parties if used correctly.