Samira Kawash traces the tradition:
Today the association of Halloween and candy seems natural, inevitable. But 100 years ago, there were many holidays that were equally un-candified. Christmas was the first, most “natural” candy holiday; it was an easy leap from oranges and cakes to candy sticks and chocolate boxes. The candy trade didn’t have to do much more than put their product out there. But other candy holidays were made, not born. The first candy promotion holiday success was Easter. Candy makers emphasized molded candies for the holiday, most of which look just like the Easter candies of today: bunnies, chicks, eggs. But in the days before trick or treat (which was not popularized until the late 1940s), there wasn’t an obvious use or demand for candy at Halloween, or at any other holiday for that matter. If candy sellers noted Halloween at all, it was as a theme for window displays which changed every month with the seasons.