Secondly, the tax offices presumably have a right to carry out audits and don't need to substantiate why. I would think that they could use any method ranging from a dice roll to an anonymous tip on a hotline to trigger an audit. The trigger would not be used as evidence in the trial... it may be from a jealous lover who's lying, but if the audit reveals you didn't pay your taxes properly, well there you go.
Thirdly, it may not even matter. Saying 'we have this material' is a great bluff on it's own and could be used to get rule breakers to come clean on their own, as well as sending a message to would-be tax dodgers that it's getting harder and harder to cover your tracks.
This doesn't say anything about the moral issue of tacitly condoning stealing documents by paying for them, though.
While conducting these clandestine operations they may also collect information which could convict someone domestically in court... but US courts will not permit that evidence to be submitted as it was collected illegally.
External intelligence agencies would be kind of an exemption. But not in the case of the CIA, as they give information to internal intelligence agencies, although they shouldn't, at least by the law.
Germany for example doesn't have that, at all, as our Federal Constitutional Court has rules in exactly such a case (tax evasion lists bought by a German state and used to search someone's home).
I wouldn't be surprised if Denmark did it the same way.