In 1975 the U.S. Congress passed the Metric Conversion Act. It didn't mandate that companies sell their products in metric sizes but did lay out a way to convert voluntarily. Other soda companies figured that's where the nation was heading and got on board.
The gallon originated as the base of systems for measuring wine and beer in England. The sizes of gallon used in these two systems were different from each other: the first was based on the wine gallon (equal in size to the US gallon), and the second one either the ale gallon or the larger imperial gallon.