If China has hostile intent it also increases the risk of Chinese action, because - dependent on stockpiles and security - Taiwan is a resource choke point which could potentially decapitate the entire US military machine.
This is a terrible situation for the US to be in.
As the US replaces that capability on its home turf Taiwan's strategic value wanes, which paradoxically makes an attack less likely because China can get what it wants from Taiwan by conventional economic and political means.
The question is... how lucky/aggressive does China feel? And how just-in-time is the US military supply chain?
The military doesn't really worry much about price.
It's not just a price component, but a performance and viability of new designs one, at a time where the DoD internally is pushing ML hard as a major pillar of investment in weapons technology.
If you're TSMC or Samsung you probably had a conversation with US officials along the lines of: Build fabs in the US, or we will tariff and tax our way back to a mostly domestic, American owned industry. 60% of TSMC's sales are to the US customers. There's not much of a choice there.
Instead, this move ties the success of the American facility and the Taiwanese facility together, building a bond and interdependence.
Sort of.
TSMC's interests do not perfectly align with Taiwan's. TSMC putting fabs in the well-defended territory of its customers makes sense.
That said, China being able to credibly threaten a critical supply line is a security issue for America. It constrains U.S. response options to an invasion, threatened or acted upon. Removing that constraint does make Taiwan a bit less critical to America. But U.S.-Taiwanese relations predate TSMC. On the net, these plants free America to be more aggressive with China, which is broadly in Taiwan's interest.
Why now? In a word: automation. Semiconductor manufacturing has become far less labor intensive since TSMC was founded in 1987. That makes the American labor premium less material.
I think you're failing to take into account a number of things. First and foremost the very foundation of the US is based on respecting IP law given we're almost entirely an "information" society. If we suddenly steal TSMC's business secrets because it's convenient, what's preventing Europe and our allies from taking ours? Why would they respect IP law if we don't?
Second, regardless of the technical reliance we have on Taiwan, there's no planet on which the US wants China expanding and taking over other countries in Asia for political reasons.
The factories in the US ensure that the US keeps sending business to TSMC.
It probably comes with some benefits, but I doubt volunteering to be a potential hotspot for WW3 is really worth those benefits.