Aristotle had a moral compass (What is justice? was a major topic for Greek philosophers). Aristotle thought that slavery was permissible so long as the slaves are not Greeks.
The Nazis also had a moral comass: some races are inferior to other races and the existence of inferior races is a threat to society in the same way that germs are a threat to humans. They even talked about a racial hygiene movement: we must eradicate subhuman races as we eradicate viruses that cause disease.
Capitalism is predicated on humans acting out of rational self-interest and the invisible hand of the market producing the best outcomes. The problem with acting out of self-interest is that the inevitable result is: “greed is good” (Gordon Gekko in the movie “Wall Street”) and “selfishness is a virtue” (Ayn Rand). Notice that what is moral is certainly both good and virtuous.
The problem with defining good as what the market produces is that this is the naturalistic fallacy (defining good as some natural property). One thing markets produce is concentration of wealth in a few hands. But you can still ask the question: "Is concentration of wealth in a few hands a good thing or a bad thing. The obvious answer is that concentration of wealth in a few hands is a bad thing because as Supreme Court Justice Louis Brandeis famously said: “You can either have concentration of wealth in a few hands or you can have democracy, but you can’t have both.”