Government certainly can change this reality (perhaps via the defense production act) by agreeing to buy masks off the line for a time after the immediate demand has been met. Or whatever.
None of this stuff - for example, defense contractors being managed by the government and permitted to make a reasonable but not excessive profit during wartime, or the early and middle stages of the cold war - is even especially complicated. It's an ideological prohibition against the government managing a company's profits in a specific area, and of course globalization of the relevant corporations, that prevents us from doing it. I'm not sure about the globalization part - I expect 3M and other conglomerates would be happy to work things out if they were dealing with people in the federal government who were even approaching sane, trustworthy and intelligent.
Instead they encountered this:
https://www.nytimes.com/2020/05/05/us/jared-kushner-fema-cor...