He was played for two reasons.
1. It's likely Foxconn had already decided this well in advance of the 2016 election cycle. So him winning the election and this projected deal aren't related.
2. Even if him winning the election may have affected the decision it's still not him doing this, it's Foxconn. And the fact he's promoting this deal makes him the stooge for Foxconn. All he did was give them free PR (I hope his advisors told him that). So for a man who claims to have good business sense he basically did something for free.
3. The tax dollars don't matter, it's the fact Trump is like the soupstone guy from the fable. He didn't contribute anything. He produced exactly no value here.