One legend about this holiday treat says that it's shaped like a "J" for "Jesus" & the white stands for his virgin birth
Some 
say the white of the candy cane represents the purity of Jesus and his virgin birth.