I don't think it originally
was (or is) associated with atheism in particular; fedoras became associated with arrogant,
holier-more euphoric than-thou losers (usually Redditors in particular) after people noticed that said losers seem to like wearing them because they think it makes them look cool:
View attachment 47538
Fedoras are used to describe quite a few groups, actually, although they all consist of douchey, smug men. When you think about it, the intersection between euphoric atheists, neckbeards, Nice Guys, and white knights is pretty fucking blurry, honestly.
It's a real shame, because fedoras look amazing when they're worn right.