Here's my understanding:
USMC:
1966 to 1977: M40's used 1/10 twist, 24" long barrels made by Remington. It was designed/assumed for use with the M118 ammo (174 grain bullet)
1977-2016: M40A1/A3/A5 used 1/12 twist, 24" SS barrels made by various makers, with Schnieder being the most common since early 200Xs. It was designed for the M118 and then in the mid-to-late 1990s the improved M118 LR round, which used the more consistent 175 grain SMK bullet.
2016-present day(?): M40A6 used a 1/10 twist, 20" SS barrel made by Schnieder. (Barrel shortened to 20" for shorter overall length w/ suppressor, and twist rate was increased to 1/10 to presumably provide enough rotational spin for the 175 grain SMK bullet in the shorter 20" barrel.)
US Army:
1988-2011: M24s adopted the 1/11.25 twist, 24" long barrels. Why? It's a good compromise. US Army snipers were trained to use M118 with 174 grain LC ammo (and later the M118 LR w/ 175 SMK), but in an urgent/combat situation in some foreign land, snipers needed to be able to shoot M80 machine gun ammo (147 grain bullet) out of an M24, and retain relatively good stability/accuracy. Obviously accuracy would suffer with generic M80 compared to M118 match ammo, but the 11.25 twist rate back in the 1980s was reportedly tested and adopted as the ideal compromise between the two ammo types that a US Army sniper would have access to in the field... Big Army being Big Army, presumably wanted maximum flexibility re M24 ammo usage. My 2cts.
As an anecdotal observation on the 10th Special Forces Group M14 sniper rifles made at Ft Devens MA (aka the M25 rifles). The original XM25 sniper rifles made in the late 1980s used a 1/10 twist 22" medium weight match barrel, but pics/documentation on the later M25s made circa 1993-94, showed that 1/11 twist heavy profile 22" barrels were used. The ammo used was the same in that era, M118 Special Ball. I thought that slight switch in twist rates was curious, but I guess by the early-to-mid 1990s, the 1/11 twist rate became popular, in part due to the M24's use of the unique 1/11.25 twist rate.