How are you going to make it expensive to do something illegal? Are you going to pass a law?
Increase the risk of getting caught for doing something illegal. In this particular case - pass a law stating that every illegal immigrant who reports his employer gets a 5 years of compensation (funded from fines payed by employer) and a fast-track to legal immigration.
Define "them". China is a country with a large number of pirated (and therefore unpatched) Windows installations. Many of those machines are part of spam botnets and so on. You have no way of knowing who is controlling those machines. If those people could hack into US govt computers, it's pretty damn likely they could hack into Chinese govt computers too, and use those as a relay. The probability of Chinese govt being incompetent in this case is way much higher than the probability of them being both technically competent and malicious.
Living on Earth may be expensive, but it includes an annual free trip around the Sun.