I've just learnt that race plays a major part in culture in the US. My question is, why?
In the grand scale of things, racist slavery and segregation didn't take up that much time. Other cultures around the world revolve around geography, religion and partly ancestry, isolation also plays a part, and it took a lot longer for a culture to form and become distinct.
The US is such a large place, so why does race play a larger role in differentiating culture than geography?
First, like other places you mention, cultures in the US is not homogenous and is very much shaped by factors you mention (religion, regional identity, socioeconomics), but the idea of White supremacy has been entrenched in American identity since the arrival of English settlers in the early 17th century (or possibly earlier, as Drake had brought Africans and Turks to Roanoke from his raids on Spanish colonies in South America and the Indies). So roughly 350 of 420 or so years of (English) colonial history and America as a nation have been marked by slavery and de jure segregation. That's proportionally a huge amount of time.
Alan Taylor does a nice job in the book American Colonies contending that White supremacy was so readily espoused by English settlers because many sought to escape an aristocratic system where lineage and established wealth gave one power. Because many of the early colonists had neither, in establishing a new caste, they made the criterion for power what they already had: white skin. I(t is important to note that various European countries' settlers largely handled the concept of race differently. I'm speaking toward the English perspective).
From that early colonial period, the diffusion of this concept has largely followed America's march West to the Pacific and shaped the treatment of indigenous peoples, Mexicans, and Asian immigrants in the 19th century. While nativist sentiments in the 19th and 20th centuries targeted non-whites like Jews, Irish, and Central and Eastern European immigrants, the idea of Whiteness lending power remained steady, even after the end of government sanctioned segregation.
Even though government sanctioned segregation ended in 1954 with the Brown decision, the US remains a very segregated place. Much of this can be linked to the historic income disparities between White and non-White populations, with the Black community being worst off. These disparities were exacerbated in the 1930s, 40s, and 50s when the White community largely benefited from New Deal programs, the war and post-war economic booms, and education and affordable mortgages provided by the GI Bill. The latter part of the 20th century saw the continuation of White flight to suburbs, the destruction of inner-city economies, and cyclical poverty for the remaining inhabitants. It also created the de facto segregation that persists today.