Adam Smith didn't phrase it like that, and many people have mistaken "similar" for "identical" when this is absolutely not so (we also didn't have a deep understanding of what's now called Goodhart's law until much later), but it has made a huge difference to the quality of life of many people despite the things it does wrong.
Also don't forget that we don't, and never have, lived in a pure free market, and that governments can and do pass laws to restrict what business are permitted to do — lots of money to be made in selling cocaine and heroin, both used to be sold as cough medicine, and then the law changed.
[0] phrased weirdly because most people disagree about how to draw the "ethics" vector, too.
Even one example of correlation between two things is sufficient to disprove any claim that those two things are exclusive.