Red is associated with socialism, blue rather with (republican) revolution.
Remember there were not many heraldic colors, and fewer corresponding to cheap dyes. Strong, durable yellows are expensive, and until the late 19th C. greens faded away quickly. Leaving mostly white, blue and red. Both the 'Stars & Stripes' (but I doubt they were much displayed during the AWI) and the French
Trois Couleurs combine both.
I'm unfamiliar with the history of US colors symbolism, but indeed blue was the color of the first 'decent' US Army uniform (red was excluded, being the traditional uniform color of the British Army). And the American Revolution was republican indeed, but socially conservative.
As for France the
Trois Couleurs indeed combine the white of royalty with the blue and red of Paris (ironically blue and red were also the older colors of the French royalty, since the 2 French war banners, the lilies on blue
Bannière and the flames on red
Oriflamme ; blue being the field color of the French coat of arms became the king's color and red the queen's : white came far later, late in the Renaissance iirc, at first as the mark of the king's prsence on the battlefield, later as the mark of a delegation of the king's authority). White really became explicitely the color of royalty only among the
Emigrés,
Vendéens et
Chouans by oppostion to the '3 colors'. This left blue and red as the potential 'revolutionary' / 'republican' colors. Since the uniform of the hereditary enemy, the Englishman, was red the new uniform of the
Volontaires Nationaux, then the whole republican infantry, was blue (1).
"Les Bleus" became synonymous with 'republicans' during the civil war in Vendée:
https://www.youtube.com/watch?v=mYWjSfXspNI
During the "50 the little town in provence I spent my summer holidays in still had 2 marching bands: the
"Blancs" (right-wing & devouts) and the
"Bleus" (left-wing and skeptical)! Blue being already taken by the (now moderate) republicans, left only red for the 'more radical' socialists; fittingly red, because of its association with blood and red, looks more 'extremist' than blue.
So blue is historically associated with 'republican' and, initially at least with 'revolutionary' (and not specially with peaceful ones, re the Terror). Blue became in some context associated with 'conservatism' (by contrast with 'reactionary' [& often Christian fundamentalist] white, 'socialist' red and 'extremist [both anarchism and some forms of right-wing extremism] black) partly because once settled many republics (and republicans) turn politically and socially more conservative with time (in France the
Radicaux ('radical republicans'), the leftmost parlementary group under the early 3rd Republic, are now moderatly right wing): republics become 'the established order'. Parly because of the blue shirts of several 'hard' right wing groups during the Interwar and WWII, but this is ambiguous because many of these groups felt 'revolutionary' ("against the Red and the ploutocrats") and even 'socialist' (Doriot and the militants of his PPF were basically 'communists converted to patriotism').
How -to come back to the OP- could blue become the color associated with 'socialist revolution'? Had the traditional color of the British army be blue, both the 'Continentals' and the French
Volontaires would had received red coats, red would mean 'republican' [± soon moderately so], leaving blue for socialism. But in our culture black (by defect of red) have far more 'revolutionary / extremist' appeal than blue, the color of Virgin Mary...
---
1 Another consequence is that
"bleu" in French came to mean 'newbie / new recruit / beginner' (as 'green' in English) because after the
amalgame infantry 'demi-brigades' combined 2 battalions of volunteers in blue coats and 1 battalion of 'professionals' of the old royal army still in white uniforms.