tl;dr summary is that the root cause depends on your perspective. If you have a CS background you might define the root cause as being the bugs. If you have a management background, you might conclude the root cause was bad/malign management by the board, the civil service and the C-suite. If you have a legal background you might conclude the root cause was the unusual prosecutorial powers, the default assumption courts make that computers aren't wrong and so on.
As this is Hacker News let's roll with the first. There were many different bugs over many years and there was no single root cause. For example at least one case was caused by defective touch screen hardware that would go haywire when nobody was around to see it e.g. overnight, and start generating random clicks. Given enough random button pushes it was possible to ring up transactions that never happened, and thus never had money deposited in the till, creating phantom losses.
In other cases there was loss of transactional integrity. Database writes went missing or got duplicated due to race conditions, not helped by the original Horizon architecture in which the connection to the central DB was asynchronous, due to the existence of post offices in very rural places without good internet connectivity. It's what would nowadays be called a "local-first distributed edge deployment" or something similar. Lots of ways for that to go wrong, and if you don't have exactly-once execution in an accounting system it will appear that cash was stolen because the records say a sale or refund was made, but it wasn't.