I don't even think sour candies are necessarily that popular anyway. Chocolate still seems to be the number one candy by far. That being said, people like sour candy because it's delicious. :)
Given acidity is one of the 5 basic characteristics of wine, I suspect people, even adults, have been enjoying sour flavors for a few thousand years. Also, preserves have tended to be sweet, salty, or, you guessed it, sour for a long time, as well. They only thing that has really changed is our delivery vehicle for sour snacks.
That's like saying hot peppers are delicious. They are, but they are one subset of the spices, or even the foods available, many of which are also delicious, but in different ways.
Suddenly one extreme flavoring has easily 1/3 of the market, a market once dominated by candy bars and gum. Chewy candy has exploded. And along with it, sour candy as well.