There is no such thing as an immoral and legal tax strategy. There are no "morals" involved in paying your taxes legally.
There are in the UK, and there is now a moral dimension to the legality of tax schemes.
We have aggressive tax avoidance, which is deemed illegal. That means that if a person or business takes advantage of a legal means to avoid tax that is against the spirit of the law, he or it may be prosecuted. Ideally, those legal loopholes wouldn't exist, but this is a compromise.
Just think how many times in a day we, on a personal level, make decisions that can be legal but morally wrong. It is often up to us to police ourselves. But when corporations lose their sense of moral compass, it is necessary for the government to step in, as they are effectively being defrauded to the tune of billions of dollars by big business.
Sheza's comment above was excellent. It is easy to get frustrated with the Machiavellian tax laws and demand that loopholes are closed, but I suspect that if it were that easy, it might have already happened. The structure of the EU is to blame, I feel, in treating the whole of the EU as one block, yet preserving national tax laws. This is a fundamental flaw; you cannot have a single currency without a federal state. Hence, the abuses we see by Apple and other corps. I don't believe England will ever want to be part of a federal state, which is why we want to leave the EU, as that is the only successful outcome of the EU. As it is made up of so many different countries, I don't think they will ever agree to a federal union, which dooms the EU to failure.
Cook's hypocrisy is especially risible, as he claims Apple want to leave the world a 'better place than they found it'. We all know he's talking about his petty and pointless social activism, yet his hypocrisy is double: he freely does business with China and Russia because he 'follows the money' as he likes to say in the quarterly earnings, despite their support for social mores wholly opposed to Cook's. And he gets on his high moral stance about accessibility—'It's not about the bloody ROI'—when it suits him, but not when it suits the welfare of countries.
In other words, blind people are worth paying more tax for, but government isn't.
All of this could have been avoided if Apple chose to pay tax for the countries in which their products were purchased, which is where their huge profits were really made, and if Cook had not made Apple a vessel for his personal political views. We can see how Jobs was wise to keep focused on Apple and almost never be distracted by political matters. He would have still had the problems of tax, but I feel sure he would have dealt with this matter in a better way.