Probably also hedging for geopolitical risk? Not sure how only having facilities in a country at least somewhat likely to be invaded in the next few years affects the stock price but it probably doesn't hurt to put one in the middle of a country very unlikely to be invaded and very likely to want to purchase chips built domestically.
Fun fact: That's why Boeing first built their planes outside Seattle - the electricity needed to refine the aluminum was cheap.
These days, you can see that effect in the large datacenters that have sprung up near the Columbia River in Oregon.
I'd guess TSMC's siting decision had a lot to do with tax breaks, labor pool, and cheap land.