The original three-mile limit was the recognized distance from a nation's shore over which that nation had sovereign jurisdiction. This border with international waters, or the "high seas," was established because, at the time, three miles was the longest range of any nation's most powerful guns. Therefore, it was the limit at which shore batteries could enforce the nation's laws.
The 1988 Territorial Sea Proclamation established the "high seas" border at the current 12-mile limit.
Note: There are many administrative limits in addition to the 12-mile limit. These include: limits for discharge of sewage, dumping of trash, burying of casketed remains, and many other restrictions.
Note 2: For those who emailed, the answer is yes. Gambling cruises go out 12 miles to get into international waters where US federal and state laws do not apply. You can then gamble away to your hearts content.