In as much as the Chinese firms (which in many cases are quasi-state-owned) that do the theft are breaking treaty and contractual commitments, then the piracy is both illegal, and immoral. Not honoring binding commitments is wrong.
I have personal experience with this, with, as it happens, Huawei, who licensed code from the European company I worked for, used it far more widely than the license permitted, and then, when we attempted to negotiate a broader license, simply dropped their license entirely, continuing to use the code until they had reverse engineered it and could generate new instantiations on independently of us. (That much I know to be true; I actually suspect, but don't have conclusive evidence, that employees of our Chinese subsidiary who went to work for Huawei stole source code on their way out the door, making most of the reverse engineering a simple hiring decision for Huawei. I also have reasonable evidence that another Chinese firm did the same with a major American technology company I later worked for, although again, it's difficult to prove).