You write software tests for the same reason you do double entry: error detection of a technical system that has expected results. The only difference is that accounting has "real" numbers whereas software is algorithm definitions, so you have to plug in real values to run the tests.
It's also telling how similar (and unforgiving) both software and accounting can be. The mischaracterization of a column in accounting could be the difference between profitability and insolvency for your company. The mislabeling of a macro in your program could be the difference between correct execution and a segfault.