Corporations are allowed to exist by the public (via the representatives of their collective will, i.e. government) under the belief that doing so will, overall, result in a net benefit to the public. Making a profit or increasing shareholder value are secondary considerations. They can be motivations for why a corporation exists, but don't have to be (there are plenty of non-profit corporations). They are not the sole raison d'être for the artificial constructs we call corporations.