Do hats REALLY affect gameplay?
The answer that mostly everyone will give you is
"lolnu u dun ned nu hatz ter be gerd"
But lets look at this here, mostly again everyone will think that you're a f2p, even if you're not, when you have no hats, instantly thinking you're a noob, and soforth.
What can this affect?
If a medic thinks that you're a noob, then may not heal you or pocket you, just thinking that you're not worth pocketing.
This can also affect the other team.
Some people on the team will see you as a straight up target for killing, thinking that you won't fight back, so all will probably target you (especially spies), putting you in bigger danger.
But this all falls down to how smart your teammates are, how smart the enemy team is, and how smart you are, so this may not happen all the time.
So the lesson learned today is:
Don't play on valve servers.