I expect the additional cost of salaries of US CBP officers in Taiwan is negligible in the larger scheme of things.
I imagine this is part of a bigger plan to do more pre-clearance globally.
One advantage of doing pre-clearance is that aircraft can go from Taiwan directly to other airports, bypassing overloaded airports like LAX. In a post-COVID world, they can also avoid having people arrive sick. The Asian countries have done much better with Covid, and keeping them separate would be a win.
There is probably also more customs pre-clearance of freight going on, and a lot of air freight goes via passenger aircraft.