Two factors which predate World War II by several years but are related to the war and have a bearing on this question are, first, the gold-medal winning performance of Jesse Owens in the 1936 Olympics, and second, Joe Louis's KO of Max Schmeling in 1937. Though the overwhelming majority of white Americans of that period would never have openly admitted it, many would have at least unconsciously recognized that their own racism had something in common with that of the Nazi regime. The accomplishments of those two African American athletes were a signal to the world that racist thinking was without any foundation of fact. In the war the US finally entered in 1941, both of our major enemies, Germany and Japan, based their ideology on racism and carried out genocidal campaigns. The Germans exterminated or exiled virtually the entire Jewish population of Europe, while the Japanese less systematically massacred huge numbers of Chinese in Nanjing and elsewhere, considering themselves the "master race" of Asia much as the Germans thought themselves that of Europe.
Americans could not help but see the implications of their fight against the Axis Powers, though, as stated, most white people then would never have openly admitted the unfairness and the irony of drafting African American men to fight to ensure freedom in the world at large when they were kept segregated in the armed forces and at home.
There was an additional irony in the ultimate victory of the Allies. The war itself had the effect of beginning the destruction of European colonialism. Gandhi's "Quit India" campaign, as well as the fact that British, Dutch, and French colonial control over Southeast Asia had collapsed like a house of cards in the face of the Japanese invasions, showed that white dominance of the world was coming to an end. In the US, the Democratic party, which had previously been the party of racism, began to be changed during Franklin Delano Roosevelt's administrations into a party that would represent all Americans, regardless of color. The victory in World War II, though Roosevelt did not live to see its completion, strengthened the credibility of FDR's progressive thinking and his platform of inclusiveness. In the aftermath of victory, his successor Harry Truman made the decision to de-segregate the armed forces. All of the factors listed above contributed to the inevitability of this decision.
From that point, the Civil Rights Movement as we know it began to take shape. What had begun with the victories of African American athletes a decade earlier was furthered in 1947 with the integration of US professional sports, with Jackie Robinson becoming the first black player in Major League baseball. And from that point, there was no turning back. America began to be transformed.
There are at least three ways in which World War II helped to lead to the Civil Rights Movement.
First, the rhetoric of America’s involvement in WWII helped to make it seem more important to give equal rights to African Americans. During WWII, the US played up the fact that it was an inclusive democracy that was fighting against a racist, fascist, dictatorship in Nazi Germany. US propaganda emphasized the multi-ethnic nature of the United States and its inclusive democracy. By emphasizing this aspect of our country, the government was implying that it was important to allow all people to have equal rights. After the war, African Americans did not simply forget this idea.
Second, World War II involved large numbers of African Americans fighting for their country. They were often treated very poorly while in uniform, but they still served. These people, as well as many of their fellow African Americans, came to feel that they had paid their dues for the country and deserved to be treated well.
Finally, WWII brought about changes in the geography of the US. Blacks had been moving north ever since WWI, but the pace picked up during WWII. This meant that, after the war, there were many more African Americans in parts of the country where they were allowed to vote. Their votes became important to some politicians and those politicians came to be more sympathetic to their needs. This helped to push the Civil Rights Movement forward.
In these ways, WWII sent messages to African Americans that they should be free and it encouraged them to move to places where they had more political influence. These things helped the Civil Rights Movement to emerge.