Capitalism does a lot to kill motivation on the right things. No matter how hard I work, I will never make as much money as some guy who sells cosmetics on Instagram. In Malaysia, we have architects quitting their jobs to become bakers, lawyers quitting to sell noodles.
There's also the question on whether inventions, medicine, technology are what we should be optimizing for? Depression and mental health are high despite all this, probably worse in wealthier countries than poorer ones.
The real cost to inequality is that it correlates with political polarization. Countries that are more equal tend to have politics that agree on more things. Political instability is one problem, but it also leads to distrust of the government, leading to the anti-police and anti-vaccine movements we've been seeing lately.