[measure of weight or capacity], late 14c., “the quantity necessary to fill a tun or ask of wine;” the word is identical to tun (q.v.) “large barrel for wine, ale, or other liquid,” often one of definite capacity.
The “weight-and-capacity” sense was (eventually) given its own spelling. The spelling with -o- became established 18c. (OED says “from c. 1688”); it is attested from 14c (tonne), and, though not phonetic, may have been retained partly because of the prevalence of Old French tonne, Medieval Latin tonna in legal forms and statutes in England.
English is tonnes of fun.
And even aside from the “ton”/“tonne” difference, it used to be “tun”:
https://www.etymonline.com/word/ton