This phenomenon is called regulatory arbitrage, and it is a feature of national sovereignty not a bug. In fact, most developed countries has relatively high tax compliance with a relatively high tax by historical standard.(imagine the tax evasion in the middle ages).
It is a bit like a race to the bottom, if a country does have lower tax, or favorable treatment, it would incentivizes companies to past income through.
Now, here is the rub, 1 percent of something is always better than 50 percent of nothing, so the wisdom goes.
The idea is similar to prisoner dilemma, it is rational for countries to defect and stuff it to the foreigners. That is not even accounting for what some people like to called the corrupting influence of money on politics and power and lobbying.
In your case, it is not so much that Ireland taxpayer got stiff, but in fact taxpayer in foreign countries that got stiff. Since foreign tax payable was reduce by shifting profit to Ireland, and Apple paid little to no tax in Ireland. Though without this deal, Ireland probably won't get any part of those tax anyways.
So, while countries technically can use national sovereignty to do whatever they please(within the laws/customs of each country in turn), the stable solution to this system might very well be the current situation.
Notice that the proposed international tax reporting is done in the OECD, and generally done to exclude those developing world that has the most tax non-compliance.
In fact, one of best tax haven for non-Americans is USA since IRS generally does not make the effort to assist foreign tax collection agency(with some exceptions of course).