When the IRS is enforcing a corrupt law, it makes people who fear the corrupt law being enforced against them view the IRS as the bad guys. That it is the law only hurts the IRS's position in this. Until the IRS makes the truly wealthy pay their fair share, not their legal share, they will find themselves in a position lacking moral authority.
Put another way, yes those loopholes are legal, but so is reducing the IRS's budget until they aren't able to operate at all.