It sounds to me like the problem is that the German economy failed to produce a Google competitor or, at least, a decent local German online advertising network that the German consumer would want to use. So, now they have a problem that they're trying to solve with taxation instead of innovation. This won't work, it just creates barriers to international trade in global world. It is 19th century economics.
> have over local companies by not needing to pay taxes at all
That is incorrect. They pay their taxes in their home countries. Why should they be penalized extra over local to Germany companies by having to pay double tax: once at home and once in that country?
A few years ago, that taxation could be indefinitely deferred, but that's no longer the case. So calling it a tax haven is somewhat misleading if we're talking about US companies.