US tax law is stupid and illogical which is. Nothing like tax inversions would exist if they didn't benefit the government in a number of ways to at least the same extent they benefit the companies using them. Laundering money, hiding money government pays companies, and so on.
Nothing like tax inversions would exist if US tax law were not as stupid as it is and has been. When the cost of compliance is less than the total cost of avoidance companies and people pay their taxes.