In aviation, accidents never happen because of just a single factor. MCAS was mainly an issue in lack of adequate pilot training for this feature, AF447 was complete incompetence from the pilots. (the captain when he returned to the cockpit, quickly realized what was happening, but it was too late)
There's almost never a death where there is a single factor, regardless of aviation or not. You can always decompose systems into various layers of abstractions and relationships. But software bugs are definitely a contributing cause.