Good question, unfortunately it is one with no real answer. All I know is that before 1900 candy canes were all white and after 1900 candy canes started to appear with red stripes. It is also around that time that candy canes started to be flavoured with peppermint and wintergreen so it is possible that it had something to do with the flavour of the candy but that is pure speculation.
There is a story that goes around regularly that goes something like this:
A candy maker stained the candy cane with red stripes. He used three small stripes to show the stripes of the scourging Jesus received by which we are healed. The large red stripe was for the blood shed by Christ on the cross so that we could have the promise of eternal life.
While it is a nice story for some people, it is probably just that, a story. There are no facts that I have found that proves that is why candy canes have stripes.