According to Reader’s Digest, the real reason behind the color pairing is less wholesome: Since its inception in 1886, Coke was sold in American drug stores—so was alcohol. Alcohol was taxed at the time, but soft drinks weren’t.
The Coca-Cola Company began painting its barrels red in an effort to make it very clear to customs and tax officials that their barrels did not contain booze, and should not be taxed.
The company itself offers a simpler explanation: Coca-Cola inventor Dr. John Pemberton’s bookkeeper and partner, Frank Robinson, designed the iconic logo. Robinson liked the way red and white looked together and would write “Coca-Cola Delicious and Refreshing” with red lettering over a white background on the company’s early signs.
“From there, red was adopted as the overarching color of Coca-Cola,” said Coca-Cola archivist Ted Ryan.
"The most wasted of all days is one without laughter." - e. e. cummings
I have long heard the story ... which may be apocryphal ... that the original Coca-Cola contained cocaine. If it's true, I guess they didn't tax cocaine.
At the beginning yes it was seen as a medicine at the time (1891). That ingredient was gradually replaced over the next 40 years. In 1902 it was as little as 1/400 of a grain of cocaine per ounce of syrup. It Didn’t become completely cocaine-free until 1929, but there was scarcely any of the drug left in the drink by then.