It did what it was designed to do. That said, it was defective because it wasn't designed to do what it should do. The point of the new software was to make the plane safer. The software did the opposite, and therefore was defective.
Logic like that will lead to another crash.
The design was defective the code was not. It is simple.