I've recently become really interested in the Spanish Civil War and have been really confused about the amount of foreign people who went to fight in the war and why.
It was seen as incredibly ideological, sort of a grand symbolic apocalyptic battle beween Left vs. Right.
The active participants in the war covered the entire gamut of the political positions and ideologies of the time. The Nationalist side included the fascists of the Falange, Carlist and Legitimist monarchists, and Spanish nationalists and most conservatives. On the Republican side were most liberals, Basque and Catalan nationalists, socialists, Stalinist and Trotskyist communists, and anarchists of varying ideologies.
The political and emotional repercussions of the war went well beyond one nation. Republican sympathizers proclaimed it as a struggle between "tyranny and democracy", or "fascism and liberty." Franco, on the other hand, viewed it as a battle between the "red hordes" of communism and "civilization," or the traditional, conservative values of Spain.
http://www.netcharles.com/orwell/articles/col-spanishcivilwar.htm
My 2 cents is that because this war created the modern binary idea of Left and Right, much more than the French Revolution did. Before that being conservative often meant being an aristocratic individualist who would absolutely loathe fascists. So it was really a watershed moment that they would team up. It created the idea that perhaps conservatives can be seen, or at least painted unfairly but believably as anything similar to fascists, just more moderate. Before that it would have sounded incredible. Similarly, as it was a nationalist revolution against a liberal democracy, on the Left side as well liberal democrats would be allied with anarchists and Stalinists, which was also a very new idea, the average liberal democrat or average progressive left-leaning person used to be more anti-communist before that. So again it created that very new idea that despite all the huge difference there is a certain sense of progressive brotherhood linking everybody left from the center, from hardcore Stalinists to moderate liberals. So it created the whole modern political setup - the view that conservatives can be seen as a moderate fascists, and the view that liberals can be seen as a moderate communists or at least as people who have "no enemies to the left".
Of course it is a huge oversimplification, I just try to point out the incredible amount of ideology invested into it, and how at this point in history the diversity of many political ideologies got reduced to a simplified left vs. right.
/u/rossebegye is correct that ideology was a prime motivator for many involved in the Spanish Civil War. However, we must remember that most of the individuals that volunteered to go to Spain to fight had their own individual motivations to join the conflict. I say most because there were thousands of Germans that purportedly volunteered to join the Condor Legion, while the reality was that Spain was a testbed for the nascent Luftwaffe. Similarly, there were tens of thousands of Italians who served in a veritable Italian army and air force in Spain for the Nationalists whose volunteer status was a sham crafted to skirt the official policy of nonintervention by the European powers. In reality, it was a way for Mussolini's Italy to undermine British interests in the Mediterranean as well as a check on French power in the region. There were a number of legitimate volunteers for the Nationalists, particularly a unit of Irish fighters who were primarily motivated to defend Catholicism in the wake of anticlerical violence in the Republican zone.
As for volunteers for the Republic, there were many ideological volunteers who fought either for a cause or against another cause. Communists, socialists, anarchists, and devout republicans rallied to the Republican cause to advance their own view of how the world should be structured. Others were more motivated by anti-fascism rather than a positive view of any of the alternatives--particularly exiles from Germany and Italy. Remember, the Spanish Civil War began in 1936, when the world was still recovering from the Great Depression. Which system of government best served the demands of the day was very much up for debate. Communism, fascism, democracy, socialism, and many others were being championed--and the Spanish Civil War featured many of these factions. Further, two different versions of monarchists were featured, and there were a few devout monarchists that joined the fray as volunteers as well.
Politics wasn't the only motivator, though. Regional aspirations among the Basques and Catalans drew support from people who had emigrated from those regions. Economic interests from foreign investors led to support from foreign sources as well.
You say you are confused by the subject--welcome to the club. I've studied the Spanish Civil War for a good number of years, and the deeper I dig the more complexity I find. Much like an onion, once you peel back one layer you simply find another layer to examine. The subject is rich--Paul Preston claims that the Spanish Civil War has produced nearly as many volumes of history as World War Two in his updated introduction to his The Spanish Civil War. I have not studied the International Brigades to any great extent, but I would recommend the following books for general histories:
Paul Preston The Spanish Civil War--excellent for the ideological components of the war
Antony Beevor The Battle for Spain--excellent for the military aspects of the conflict
Hugh Thomas The Spanish Civil War--an aging account, but it has been updated and remains a very good summary of the war
Paul Preston The Spanish Holocaust--a landmark account of the atrocities committed by both sides of the war
Jose M. Sanchez The Spanish Civil War as a Religious Tragedy--the best english language account of anticlerical violence in Spain during the war.