I think I've noticed a pattern with these kinds of systems: its not a software problem; it's a policy problem.
When designing (evolving, inventing) rules, regulations, policy, exceptions, limitations, audits, checks, balances, the bureaucracy's princes seem to ignore the bigger picture of what it's all become: a mess.
It's not just government systems either. There's a reason why people joke about their phone bills being difficult to understand. Same goes for most utilities.
Now, once you have an incoherent, contradictory, thousand page mishmash set of rules, every engineer worthy of the title is going to stay as far away as possible. So, the whole mess gets dumped on an army of coders from a big consultancy.
Perhaps instead of focusing on the useless software written to fit a pile of inane rules, people could focus on the economic and operational benefits of redoing the entire policy regime with a zen-shaped comb.
Software is an enabler. It's actually covered-up a lot of really awful decision-making. The US tax code could never have become what it is if developers hadn't been able to consistently keep up with crazy new patches to implement it: nobody could possibly manage it by hand.