I think the answer turns this question around: eugenics was an expression of inequality not the cause.
The people who sought eugenics programmes were suggesting things that advantaged some groups and disadvantaged others, and for them eugenics was just a tool for accomplishing those ends.
Sometimes those tools focused on issues to do with race; other times, this was about class or gender or religious views or disability. A good example was a proposal to give people who scored high on IQ tests support for having more children (such as paying for child care and increasing their wages so they had more money for the children). This was called “positive eugenics” because it was proposed to help promote desirable qualities in society. It was meant to be discriminatory, so no surprise that we, today, think it was just that. What we see now that the eugenicists didn’t see (or denied) was that scores on IQ tests were influenced not only by inherited degrees of intelligence but also by lots of environmental and developmental factors. Plus, when we study the IQ tests that were used, we see all sorts of cultural biases that prejudiced the results.
When we talk today about “structural inequities” and “privilege” we focus attention on those environmental, development, and cultural factors and how they are imbalanced in society. A simple example of a structural inequity is access to nutritious foods while babies grow before birth and while children are growing up. Nutritious foods are expensive and difficult to keep. In areas with high average incomes, nutritious foods are easy to find; in low average income areas, they can be hard to find. That’s a structural inequity. It makes life harder in some places, and it can lead to impacts on learning, education, energy levels, and ultimately on the scores of an IQ test. Eugenicists didn’t think this sort of difference mattered, but they were wrong. As a result, the whole logic of their system falls apart. I don’t call any policy “positive eugenics” because I see them as adding to structural inequities, which certainly is “negative”.
More importantly, racism was around long before eugenics. Racists embraced the idea of eugenics as a way to pretend science was somehow on their side. For example, it gave them a way to pretend that some groups of people were “naturally” better than others, and to pretend the country would be better off with more of the “naturally” desirable people and fewer of the “naturally” undesirable people. Eugenics was simply packaging for prejudice that was already there. This is true around the world - it seems not to matter which community we choose, we can find racists suggesting eugenics as an idea to make their lives better.
Sometimes eugenicists grouped people specifically on race as we understand that word today. More frequently, they used the word “race” to mean vague national and regional groups such as “Londoners” or “highlanders” or “Cornish”. But far, far, far more common, eugenicists focused their policies on two other groups: people who had disabilities and people who were impoverished immigrants. Those groups were the subjects of many laws passed and policies put in place that restricted their freedoms. Race, as we understand it today, is an important part of eugenics, but it’s not the only part.
A good example of a book that talks about eugenics as packaging for racist prejudice is Angela Saini’s book, Superior.