You need to read Leveson's full report. It details quite clearly what role software played.
If you're focusing on software and avoiding bugs you will at best have good quality software, when the goal is to have a safe system. SW is just part of the picture.