The novel certainly advocates organized labor (unions/unionizing) and the promotes the rights of the labor class. These qualities align Steinbeck's novel with the values associated with communism in the 1930s.
At that time, communism was not seen in the same ways that it has come to be seen since. WWII had not yet been fought and the political regimes that came to be representative of communism were not yet in existence.
This caveat is meant to demonstrate the notion that communism and capitalism were not opposites in the 1930s. Communism, broadly speaking, was seen as a corrective to the natural tendency of capitalism in the industrial age to dehumanize systems of production and exploit labor.
In this way, though Steinbeck's novel is clearly aligned with communist values, it is also not anti-capitalist in an absolute way. Rather, the novel too can be seen as offering a corrective view of capitalism seeking to re-humanize the modes of production and to reinforce the idea that people should maintain basic rights within an industrialized economy.
Critics have argued that the novel is political in its intentions:
Clifton Fadiman wrote that the novel “dramatizes so that you cannot forget the terrible facts of a wholesale injustice committed by society.”
Considering such criticisms, we must see the novel as making commentary political and social in nature, but this does not mean that the novel can be accurately simplified as arguing an anti-capitalist position.