Willy commits suicide so that his family can collect the insurance money afterwards. He has no other way to provide for them, his "luck" has run out, and he sees no other way to be able to meet their needs. In this respect, Willy chooses and is responsible for his own death, especially since this was his own idea and he didn't seek the advice or "help" of anyone else in coming to this decision.
In another way, though, Willy is a victim of society and the American "get rich quick" mind frame of the time. Up until the very end, Willy truly believes that a bit of luck and personal "pizzaz" will surely lead him to the success he has been striving for. He is hopelessly optimistic and optimistically hopeless in his presumption. When reality comes crashing in, Willy can't accept his limitations and evident failure and opts for the "exit door" as his only way out. Was he a coward? Was he courageous? This is for the reader to decide....
What seems to kill Willy is not just one particular thing, but a series of decisions that just kept accumulating over time and which he couldn't find the courage to face.
Willy is depicted as a pretty confident and ambitious man during his younger years, and is probably doing pretty well at his sales job. But all that traveling meant he was frequently away from his family and took a toll his emotional state, which leads to his affair, although the details are left for the reader to decide. This affair is most likely the catalyst that was Willy's eventual undoing.
If his son hadn't showed up at the hotel, perhaps things would have gone differently, but no one will ever know. The fact that Willy knew his son knew about his infidelity probably ate at him every day. He was probably both relieved AND disappointed that his son didn't tell his mother, because Willy couldn't tell her himself.
Throughout the play, we get a glimpse of how Willy treated Linda, and how much Linda still loved her husband despite how difficult he was making it to love him. As his secret ate away at him, he naturally began to change in many ways to compensate for pain he had to have felt. Treating Linda poorly could have been a way for Willy to justify what he did back at the hotel, thinking that if he treated her bad enough, she would stop loving him, maybe even leave him, because that's what he felt he deserved. His punishment for having an affair to dim the lonliness was to be alone. This way, Linda would hate Willy and leave him, which would produce the same outcome as if he told her what he did, except with the former, Linda would be left much less unscathed by his actions.
Day after day, year after year, suddenly his failure as a dutiful husband leaked over into other parts of his life and like his sales job. After a while, and after being let go from his job, after what was happening when his sons returned home, he just couldn't handle the guilt any longer.
Although he truely wanted what was best for his family, Willy's suicide most likely resulted in his family losing the insurance money, as well as providing for his family, and of course, Willy himself.
To Willy, suicide was an easier act than telling his wife two words: "I cheated."