At the macro level, yes, the size of the company's payroll is a cost. But very few members of large companies have any incentive to bear that cost. The CEO, the Board, and that's about it. Almost nobody below the C-level has any direct incentive to keep payroll costs manageable.
At the management level, the manager -- who bears no personal cost for managing N+1 workers instead of just N workers, will almost always choose N+1 if given the option. He doesn't pay their salaries, after all, and to him, the increased headcount is a status symbol. It's also something he will convince himself he actually needs. (You never hear middle managers complaining that their divisons are overstaffed, but the opposite complaint is almost universal).
This is what's known as an "agency problem." Many (most?) of the agents of the greater whole (the company) have personal incentives that work at odds with the company's greater incentives. This clash of incentives leads to waste, bloat, inefficiency, and so forth, because almost nobody is personally on the hook for the company's total health in the long run. (Sure, they're indirectly on the hook. If the company starts doing poorly, they could risk losing their jobs. But people tend to externalize failure, and don't hold themselves personally responsible).