There are lots of comments above that range from what amounts to victim-blaming (Don't like the result? Then change the laws.) to tax education (Apple merely collects the VAT for the government, but the customer is considered to have paid it.) to hysterical outrage (kill them kill them kill them ... oh, wait, maybe that was a different thread).
In my country (USA), we have non-profit and for-profit entities, as they are commonly called. The non-profits include entities that can have considerable land wealth, like universities. Two of our most famous universities, MIT and Harvard, jointly own over half of the land in Cambridge, Massachusetts, the city where they are located. Neither of them are legally required to pay state property tax, because of their non-profit status (let's overlook for the moment that state and federal tax exempt status are related but technically separate things). But they also both benefit greatly from the surrounding city and its services, so they BOTH pay tens of millions of dollars to the city; such that are called "payment in lieu of tax" so that they retain their non-profit status. I don't know if they are paying the same amount as they would if they had for-profit status.
There is no legal requirement for them to do so. Indeed, there is a clear legal position that has been created, the not-for-profit status, in order to provide them a clear and explicit means to NOT pay, as their mission is considered important to the well-being of society. But they make payments ANYWAY. It is a moral obligation. It is also not entirely altruistic, as without these payments, the social environment around the universities would deteriorate significantly. You want nice things like infrastructure, emergency services, primary and secondary education, democracy? You gotta pay for them.
There is no fundamental reason that Apple, despite there being a legal path to avoid taxes no matter how complicated, could not make contributions to each and every country in which they sell products while still making embarrassingly immense profits. I bet some sharp-penciled tax attorneys would even find a way to make such contributions tax deductable. Apple would rid themselves of the negative press, get a nice write-off, and the countries (here, NZ) would benefit as well.