You're correlating backwards. You should be asking why smarter people tend to become atheists.