The question of immorality is irrelevant unless it is also illegal. It is the government's fault for putting so many loopholes in the tax code. They knew exactly what they were doing when they put them there, and have just as much culpability as Amazon, Google, and Starbucks.