I don't think that any Govt should be over-ruling the judiciary by way of retrospective legislation...it impacts on the effectiveness of the Judiciary to act independently and without prejudice.
As for allocating the costs, you can't reduce payments to all benefit claimants to pay compensation to those who have been treated unfairly, that would be simply making the same mistakes...unfortunately the taxpayer will have to pay, but perhaps if it can be attributed to somewhere (and with the best will in the world I doubt it is practical or even legal) then it should come out of Govt budgets rather than the welfare budgets as it was the Govt that made the mistake, so they should pay for the mistake.
How is putting the costs to taxpayers any less unfair than putting it on the benefit claimaints?