Their job is to do what is best for the company
Real sociopaths look for what's best for themselves. Everything and everyone is a step to be stepped on in the pursuit of their own self-aggrandizement. They don't care for the company, much less for what's best for it, at least not directly. They do care, on some level, but only to the extent it serves their own self-interest. The instant it doesn't, they couldn't care less.
That's why laws generally try to rein in their worst traits. Left to their own devices, sociopathic CEOs are all too happy to use slave labor, kill competitors (literally), let their employees rot in hazardous environments, look dispassionately while they lose limbs due to lack of safety, decapitate children before their parents to incentivize other to work harder, and so on, and so forth -- all things they did and continue doing whenever they can get away with it.
All of which may help a company succeed, for a certain scale of succeeding, but going for that specific scale versus any other that might be adopted isn't an automatic, natural, it-couldn't-be-anything-else fact of nature. It's a social choice that could change and go in any other direction, and under those the traits that make sociopathic leaders be the best might instead cause them to sink to the bottom.
Which isn't to mean they'd have na place in society. For example, sociopaths and psychopaths would do well working as social media moderators to block content uploaded by other sociopaths and psychopaths, this being a job that causes normies to go through mental breakdowns. Those just wouldn't be places of authority.
As for wars, indeed. If one's goal is to kill the enemy no matter how many of one's own side die, then sure, sociopaths easily take that path, no doubt about that. In those rare, rare instances, they might deserve command. But as soon as the need was fulfilled, they should lose it, so as not to cause any further damage.