You're confusing "for-profit" and "publicly traded". It's commonly held that publicly traded companies should be maximizing shareholder value (which is not necessarily the same as profit), because that's the purpose of publicly traded corporations.
There are also various protections for minority shareholders in privately held companies to prevent majority shareholders from screwing them over.
And there are various rules about how the company's officers need to pay attention to the shareholders.
In this case, there is precisely one shareholder: the Mozilla Foundation. So the various minority-shareholder protection stuff does not apply, but the officers of the Mozilla Corporation do need to pay attention to what the Foundation wants the Corporation to do. And what the sole shareholder wants the Corporation to do in this case is decidedly not to maximize profit.