"...The uniform, gentlemen, is not a subject for individual, whimsical expression...."
Lt. Col. Thursday in Fort Apache. 1948
It looks like even Black and white movies had the "yellow" neckerchiefs. See Fort Apache 1948. Possibly for some light contrast. John Wayne/ John Ford westerns are partly to blame especially She Wore a Yellow Ribbon which was in color. If you look at those Ford movies the neckerchiefs are really ratty looking and look more like cravats on the veteran characters so there was some artistry to the costume detail. Other films have the neckerchiefs looking like scout neckerchiefs. I can imagine that the wardrobe people thought "soldiers" and made the troops look alike with matching neckerchiefs.
I have noticed that reenactors will "accessorize" if not stopped by event regulations and peer pressure. Some CW artillery groups I saw back in the 80s wear red neckerchiefs, socks, shirts, suspenders, and long johns.