The IT infrastructure around tax/HMRC is ridiculously complex. The “making tax digital” initiative is trying to fix that. The aim for business taxes, for example, is that each individual business will have a single tax account eventually, rather than separate once for each tax type as they currently do.
They just need to make sure that every address is paid for every day of the year - that's the way they maximize their revenue. They don't really who pays, as long as someone does. Hence the account system keyed on address.
They then denied knowing that I had moved address, but didn't have an answer to "then why have you sent me a letter (to my new address) saying the payments for the old address should be refunded if you think I still live there?" (they literally denied knowing I had moved after sending the letters).
I appreciate that involved human incompetence not just a poor IT system, but a better system would have made the updating of me as a person paying council tax from one address to another seamless, then it would have flagged the problem sooner than a year in, and then it could have crossed my "debt" with my "overpayment" rather than passing it (in what I assume was another human mistake, but again allowed by the system) to a debt collection agency.