There's no such thing as a tax loophole. It's the law, and is written specifically the way it is for a reason. "Loophole" by definition implies that it's a mistake, and with the amount of money at stake that's incredibly unlikely.
There are many real tax loopholes even by your definition.
For example, there is an interaction between US and Dutch laws that essentially means that US companies that transfer copyright to Dutch subsidiaries don't owe any tax to anyone on the profits from that copyright (it's something like this: Dutch laws say that the tax is payed in the country of origin, US laws say that the tax is payed in the country where the copyright owner resides).
So all countries individual tax laws interacting with each other is completely "bug free"? Seems very unlikely. Maybe if there was a single global law for taxation, but even then it would have to be perfectly designed.
A much more likely scenario is that not all outcomes can be accounted for, and for those willing to pick through the laws there is money to be made by finding the loophole.
When one is found the politics of changing the law to fix it come into play of course.
I upvoted your comment but I respectfully disagree: If a country has a law that says "you pay X tax using this law/method but Y tax using this other law/method" Google are perfectly within their rights to say, "Let's use Y".
Who in their right mind would say "you know what, I'm going to pay more tax"?
Have you seen the size of modern tax laws?[1] They're utterly gargantuan!
It sounds like you agree with me. That's not a loophole. That's a conscious decision on the part of whomever wrote that section of law to basically say "pay the lesser of these two methods."
Usually a loophole is more complicated like the Double Irish with the Dutch Sandwich which requires some complex maneouvering on the part of the company to pay minimal tax.
I run a small business and that kind of thing is beyond my capabilities and would also cost too much but not for Google.
That's what I assumed you meant by loopholes... my explanation of the process was a bit too simplistic.
To me, a loophole is looking through all the laws and saying, "ooh, if we put our money here, then declare this thing, we can show a loss that allows us a rebate on a particular tax" or something... it's a symptom of excessive complexity in our tax systems.