Many homeless people here don't have ID because to make one you need an address, and to get an address to receive papers you need an ID (circling dependency).
In France, it requires citizenship to have an ID card. Legal immigrants are given a "titre de séjour", while undocumented people (by definition) don't have any of these. As a white person whose grandparents were immigrants, i've never been asked for ID in my entire life (except for official administration stuff or one of the times i was detained by police for political activities) ; this contrasts with my non-white friends who are frequently stopped by police for an "ID check".
The ID check is used by french police as a means of controlling and humiliating popular non-white suburbs. It's not uncommon in these places for cops to know the actual names of the people they're controlling, and the control itself is just another form of harassment.
There has been many anti-racist campaigns in France over the years denouncing "contrôle au faciès" (looks-based checks). If you speak some french, you can see some of the videos from those collectives who will tell you more about this practice.
Now, specifically about elections, asking for ID (not proof of residency) willingly excludes foreigners. All the while forging plausible ID cards is very accessible to bad actors (retail price of a few hundred euros a piece). So no, i don't exactly see the point.
> I am non white and find this very racist.
Sorry to offend you. It was my impression that getting an ID in the USA can also be very complex (leading to many people being undocumented) but i may be wrong about that.