To be fair, competition and investors tend to pressure corporations to place profit above any other values - the only way to maintain those values is to be forced by an external, 'arbitrary' force, like the law, or eccentric owner unconcerned with pure profit.
But they are subject to constraints! They're subject to the law (ideally, anyway...), so the two options aren't in opposition. So yes, it can't work reliably, but still better than the pure profit motive, which is guaranteed to forsake any other values.
Government regulation solved parts of it - stuff like environmental protections or labor laws. But in general, it's a very hard problem, and I don't think a theoretical solution exists yet. You can read more about it here: https://slatestarcodex.com/2014/07/30/meditations-on-moloch/