In the presence of competition "optimal for owner" equates to "optimal for the system at large", because competition between PE firms will bid up the price they pay for the initial company until it's fair, it'll bid down the interest rate the bank charges, it ensures that the assets actually go to the firm best able to make use of them, it provides landing positions for the employees who are let go and then can get the best salary possible, etc.
In the absence of competition misallocation can occur, and that's why it's the governments job to stomp out monopolies. (Something that they've been sucking at, but if you want to argue for better anti-monopoly enforcement I'm all for it.)
There's wide-ranging literature on why companies exist [1], but it's not for production. Individual laborers independently contracting with each other can produce value, and do so without the monopoly risks mentioned in the last paragraph. Usually theories of the firm center around transaction costs: it takes money to identify, review, trust, and collect payment from other firms you do business with, and so you can improve efficiency (up to a point) by centralizing all the producers in one firm under a management hierarchy that doesn't pay them directly but is tasked with optimizing output. Other theories of the firm have shown that management doesn't actually optimize output and (surprise surprise) optimizes for their own status, promotions, and other human motivations instead, but as long as the deadweight loss from them being self-interested is less than the search costs of contracting with another company, it's economically rational. P/E operates essentially by taking on that search cost of dismantling the company and selling it on the open market, and pockets the difference between the deadweight loss of manager principal-agent problems and those search costs.
Cost of capital being 0 is a separate issue. The effect of this is to make any investment with positive returns a good one, regardless of how good it is, which creates a lot of bloat and misguided investments in companies. It's essentially making the economy a target-rich environment for P/E.
[1] https://en.wikipedia.org/wiki/Theory_of_the_firm