The real question is, why did the West went along with that bad deal at first place and allowed China into the WTO under these conditions. It was extremely short sighted.
China had to carry out massive economic reforms in order to join the WTO, such as the privatization or splitting up of many state-owned enterprises, large reductions in tariffs, opening up of many sectors to foreign investment, the creation of a legal system to protect IP, and much more. Moreover, China joined under unusual terms that allowed other countries to more easily retaliate against China - sort of a probationary status.
Western companies did extremely well in this relationship. Much of the growth in the West over the past few decades is thanks to China's opening-up.
[1] https://www.wired.co.uk/article/huawei-gchq-security-evaluat...