The New York Times offers us a scientifically grounded Q&A on the subject. Why, exactly, do we have a sweet tooth? They explain that the craving for sweets is primarily biological, while the kind you might crave is impacted by your culture and upbringing. So, while American women tend to love chocolate, this isn't globally true.
Also of interest: Craving sweets is more prevalent in families that also have a history of alcoholism, which suggests a genetic component (remember, alcohol gets broken down into sugar). It could be that these families pass down sugar urges or it could be that these families have a genetic predisposition to crave things that make you feel good — both alcohol and sugar do that.
For now, we don't precisely know all the factors that influence our moth-to-the-flame reaction to the Halloween candy aisle, but a scientific approach definitely offers insight. (The New York Times)