For example, my brother and I co-own a smallish (~$5 million/year revenue) software business. We do care about money to some extent, but we regularly agree to do things that work against shareholder value because we also care about things other than money. With two people, it's easy for our values to be aligned on those other things.
With dozens or more shareholders, that's basically impossible. A publicly traded company couldn't realistically be like "hey shareholders, can we agree that we care a lot about this niche local political issue in the town the company was founded?" The more shareholders you have, the more the only commonality between them is "we want more money".
There are many family-owned businesses that are only in it for the money, but "family-owned" can be a proxy for "not very many shareholders" which at least opens the door for the company to have non-financial priorities.