So there's a lot of partial truths on this post. First 3M is not the only company who can manufacture N95 masks in the US or worldwide. They have several n95 related patents but other companies can and do manufacture respirators to the N95 specification (and P100, etc.)
Expecting the private sector to ramp up demand to extremely high levels knowing that demand will likely not be around in 6-12 months is part of the problem. Similar to the toilet paper shortage last Spring part of the challenge was people buying up masks and part of it was that we live in a global economy. Early on a lot of N95 masks were sold to European and Asian countries which in turn led to shortages in the US b/c the government and hospitals were slow to realize the increased global demand. We are used to living in an on demand society, whereas previously hospitals might buy a year's supply of masks in January and store them locally or rely on a local distributor, today to save costs they simply buy a month supply and then get replenished every month. This moves up the food chain, 3M manufactures enough to meet demand and doesn't sit on large stocks of inventory b/c this costs money. Due to massive improvements in logistics its possible to make a few million masks in China and have them reach the US in 2-3 weeks and get them in the hands of customers a few days later. Previously companies might have a 6+ month supply sitting in US warehouses.
In addition, if 3M or other companies were to ramp up production it would take time to build out the production lines and to some posters point the ROI on this investment might not pan out b/c at some point the pandemic will subside and N95 demand will go back to pre-pandemic levels. Private industry doesn't want to be left holding the bag.
However, one solution to the above challenge would be for the government to either agree to purchase a set number of masks and or to utilize the defense production act to mandate the manufacture of said masks. This act allows the government to sidestep patent and trademark issues but to be clear doesn't allow the government to get things for free; they end up purchasing what they can mandate companies to produce. During WWII ford switched production to making fighter jets, tanks and other equipment. Entire Shipbuilding factories were set-up in coastal towns in a matter of months to start pumping out warships to meet the demand of the military. This didn't happen overnight but within a year of the start of WWII the U.S. increased its military manufacturing capability 10-fold. Ford build less passenger vehicles and many women joined the workforce for the first time to help ensure enough production labor.
http://michiganhistory.leadr.msu.edu/wwii-and-ford-motor-company
https://en.wikipedia.org/wiki/Bethlehem_Hingham_Shipyard
For whatever the reason the previous administration did not make N95 mask production a priority. Remember early wearing masks was not recommended by the CDC who then changed course. There were in fact companies and that offered to produce masks if the government gave them a contract:
Had the government acted last March we'd likely have a plentiful supply of n95 masks right now, as it stands the question is now whether ramping up production now will be worthwhile b/c assuming it takes several months to boost supply the pandemic will likely be waning through herd immunity either brought upon by mass vaccination or natural herd immunity by late summer / early fall. Similarly had the US not ramped up military production right after Pearl Harbor and say waited until late 1942, WWII would likely have lasted longer.