A joke that targets a particular religion/race/etc should play on one of the given stereotypes of that particular group of people. A joke that just contains an out right insult which has no basis isn't a joke at all. It's just an insult. Hence it's no different to the other examples I gave.

I couldn't give a toss if you want to go round calling atheists fools, but don't try and make out it's a joke.

Unless there's some basis for a stereotype that all atheists are fools which I'm not aware of...