A funny thing to me about France is how very educated people can be ultra liberal/socialist in views and concurrently extremely racist and intolerant of others.
Le Pen for example is a socialist.
It makes sense in many ways. Not necessarily "racism" per se, but intolerance of foreigners / immigrants.
Socialism doesn't really work at scale for many obvious reasons, but on a smaller scale (say, a commune where everyone is fully committed and you thus don't have a free-rider problem) can be handled. The small example of course being a family--kids can't contribute, and sometimes it's determined it's better for one parent to stay home and handle child care while the other goes out to earn. So one parent goes out to earn, the other handles the household duties (kids, school, activities), and the kids are mostly just provided for but as they get older, it becomes clear that they will have duties to help out (chores, etc) as their capabilities to perform them build.
The problem comes when someone is attracted to the "free" part but doesn't really care about the "work" part. In a true socialist system on a larger scale, the free rider problem eventually dooms the whole deal. (Often contributing are central planning, the lack of a market/price system to help determine allocation of resources and goods, etc -- which is why to a large extent most of Europe are social democracies, i.e. capitalist systems with a social safety net.)
In a place like France, where it's still more of a social democracy rather than socialist, where someone from "somewhere else" will come in and offer to work for wages that the French deem beneath themselves, because they don't believe they should be subject to such competition. They are seen as upsetting the natural order of things where you make a living wage for unskilled or low-skill work, and "they're taking our jobs." (Similar happens here of course.)
It's a VERY small logical leap to go from being angry or hating immigrants, to noticing that many of them share a similar color of skin or national origin, and hating all of that group.
They're racist because the [differently colored skin] immigrants are ruining their socialist ideals by
competing.