And, transistors are certainly cheaper and more reliable than the vacuum tubes they replaced.
Economics is still a factor in regulated environments.
You can get a good grip of what's going on in the lab in Brian Kernighan's <Unix, A history and a memoir>. It's a good read.
Anecdotally, I'm not a fraction creative or innovative when I'm desperate. My risk tolerance increases but that's a disingenuous measure of innovation.
profit, or economic surplus is a requirement for innovation, doesn't matter if it's private, or public spending, what matters is that day to day costs to operate a business or society at large are met before money is spent on risky R&D.
Every rational entity does this, you take your revenue, and spend it on necessities to sustain yourself (like food and shelter), sustain your income (transport etc), and then only spend the surplus on higher risk items (stocks, vacation, luxury foods etc).
If you were on an island, and grew your own food, I assume you would also follow the profit motive, keeping a healthy excess in production for a drought or taking Sunday off to relax, or fixing your dwelling.
We can have a rational discussion about how a company and society at large distributes it's profits, whether it's internally back to employees, R&D or explicit focusing on shareholder value, or using taxes to fund R&D.
But what I assume most people have a problem with is not economic profit, but prioritizing excessive shareholder profit, over everything else. Using shareholder value as an excuse to ignore the real needs of your employees or customers, or even the long term sustainability of the company.
We also have to remember that value is subjective, and when economists talk about profit, they're talking about something subjective. someone who collects stamps for fun, is profitable if they maintain a surplus of stamps. Just like one might buy GME stock to gain in something like social capital.
Previously, the lab was protected by an agreement between the US and AT&T where AT&T has a lawful monopoly but there were only so much it can earn and X% will always go to fundamental research, and that's why the lab was so successful.
That all changed when the federal government decided to break AT&T up in 1983. The for profit baby bells had no incentive to keep the lab and they proceeded to ruin it.