Nitpick: Governments don't have "the right" to do anything. We the people consent to grant them abilities. I think reasonable taxation is a perfectly legitimate function of government -- not many would argue that. However, we are light years away from reasonable taxation. I'm a year out of school and already I work over 6 months of the year to pay taxes... But, I digress...
The law is the law. This notion that "the spirit of the law" is king is incredibly dangerous. Next level dangerous.
Have you ever seen the tax code printed out? To argue that you should "just close the loopholes" is absurd.
Also, the notion that if companies keep more of their earning then tax revenue will fall is a huge fallacy. If you over tax, tax revenue will fall. It's a proven fact, all over the world.
The answer is to simplify the tax code. Create economic certainty (from a tax liability standpoint) and the economy, as well as tax revenue, will surge.