No - I am not trying to shift the blame at all. Governments are responsible for leaving the holes in the law. Indeed your analogy reinforces my point because, just like it is impossible to produce a perfect program with no security holes, it is impossible to produce the perfect tax law with no loop holes. So while governments may be to blame it is not a practical solution to just tell them to pass laws without loop holes - just like you can't solve computer security by telling everyone to write code without any security holes. You might be able to improve things but there will still be a persistent, ongoing problem.
However your analogy does suggest a different solution: perhaps we should treat international corporations who exploit loop holes in tax law the same way that we treat hackers who exploit security holes in software. Given the ridiculously long sentences handed out for hacking I expect this would be a great deterrent...although still open to abuses of power.