One of the thorniest problems in business economics is this: we know free markets produce extraordinary results, but why is it that even in the absence of regulation, so little of the economy is structured as a free market? Very few businesses of any size operate internally as a market, instead they usually operate under hierarchical command and control. Markets generally exist only at the interfaces between organizations.
Why don't teams bid competitively within a company? How do individuals decide on the teams to form? Why are managers allowed to rise to the point of failure? Why do we pay people salaries instead of hourly wages? Why do we hire hourly wage labor as if though its was permanent?
The number of questions raised by this topic is endless.
The most general explanation is this: yes, companies adopt inefficient structures, but they more than make up for this through significantly reduced transaction costs.