Ideas like "protecting democracy" are used to sell citizens on wars they don't care about. The full destruction of TSMC is likely preferred over a Chinese dictated world technological economy. The truth is, if one side has TSMC chips and the other doesn't, what we're talking about may necessitate a total war.
TSMC chips aren't critical, considering that ASML can also deliver the same equipment to US... and cut off China from their equipment. (or sabotage in critical cases)
There's a myriad reasons, why US would probably would send in military to protect Taiwan. But it's not going to be "just because TSMC"
While upholding treaties is vitally important, I think you’re underestimating the importance of chips(a rare occurrence on HN!).
Wars are generally fought over resources rather than ideas, and pretending that US is defending Taiwan to defend democracy instead of defending its strategic interests (access to vital resources — chips) is misguided.
Loss of TSMC would result in chips shortage, but not when it comes to critical and military infrastructure.
There's a lot of resources at stake, and semiconductors are just one part of the whole.
I doubt this is true for China (I very much suspect economic concerns trump any other concerns for them as well), but I am quite convinced you are wrong about the USA - one of the biggest supporters of non-democratic regimes in the world. There is little in US history to suggest they have any preference for a democratic regime over a subservient autocratic one. They are also extremely clearly uncaring of international treaties.
And make no mistake: the USA is coordinating Ukraine's defense because it sees it as a good chance to weaken Russia, not out of some deep care for the people of Ukraine.
...to fight the spread of Communism.
For China it's about nationalism, for US it's about protecting allies/upholding treaties and protecting democracy from the strongest authoritarian regime. Chips are not important. After all chances are high they might be destroyed even in a successful defense of Taiwan.
As a Ukranian American I wish we had and were doing more for Ukraine but it's not about chips or economics. Ukraine had only recently grown closer to the US. The US has promised to defend Taiwan for a long time (well sort of, arguably the US does keep some strategic ambiguity about this which might let it wiggle out)