> If governments subsidized producers, and it turns out we end up with more masks then we need,
There's no way to end up with more masks than you need. Masks don't expire. If you're worried about the elastic expiring, require designs where the straps are easily replaceable or removable.
And masks are absolutely necessary for the future. Companies can't rely on society recognizing this, which is why they can't blindly commit to building the capacity for it. But that has nothing to do with how necessary masks are for the current situation and for the future. It's just another typical case of market failure, in the sense that a free market won't optimize for the same things you would if your priorities include things like environmental protection and health. This is something that needs to be regulated and subsidized by governments, who are supposed to be protecting us from future risks instead of pretending that there's nothing they ever could've done and nobody could've foreseen a global pandemic.
Also, if a government cares more about looking good than doing the right thing, then it's a bad government.