He didn't "commit suicide as a result of prosecution for his attempt to free scientific literature."
After a prior similar episode which earned him a visit from the FBI in which they told him they'd caught him doing something illegal, declined to prosecute him but warned him not to do it again......he trespassed repeatedly onto the MIT campus, into buildings, into network closets, where he installed unauthorized computers. He then worked to intentionally bypass the network registration system, and then further to avoid MIT's network engineering group as they tried to figure out where his equipment was installed.
His data-dumping efforts were so aggressive that they interfered with JSTOR services for thousands of researchers around the world; his 'free the research' stunt actually interfered with their ability to work. Despite bringing JSTOR's servers to its knees, he installed a second laptop because the first wasn't pulling data fast enough. JSTOR attempted to block his system, but he kept changing IP addresses to subvert the ban, and finally, JSTOR had no choice but to block the entire MIT network.
JSTOR is not some evil "take guvvmint-paid-for research and hide it behind a paywall." JSTOR is a service which archives journals and then provides storage and searching across them all, to institutions which could never afford the journal subscriptions themselves. They're not-for-profit. The fees they charge go directly to paying for the capital and operating expenses necessary for storing, cataloging, and making available for download, millions of papers - and the inherent overhead in doing so.
To what goal, I might add? He would have ended up with a directory of PDFs. Now what? They have to get indexed, a web UI needs to be made, someone has to pay for all that server hardware and bandwidth and electricity and the people to maintain it all. Maybe we could set up a non-profit organization to make that all happen?
Oh....wait...that's...JSTOR.
Does anyone now realize that his stunt was just that? A publicity stunt? A fucking tarball of PDFs doesn't help academic researchers. The whole point behind JSTOR was to collect research, store it, and make it available both at affordable rates and in an accessible way.
This was like going to the village cooperative farm chicken coop (where people pay a small fee to house, feed, and care for their chickens), blowing up the only bridge to the farm to stop the police from getting to you (but also keeping all the townspeople from getting to the eggs they need for food), throwing open the doors to let the chickens out, and then being proud of yourself for "freeing the chickens so everyone can have a chicken."
Let us be absolutely clear: there is extensive proof of all of his crimes, and nobody has argued he did not commit them. The argument from some has been that somehow these crimes were legitimate or honorable.
He was offered plea deals, and even if it had gone to trial - as a white-collar, white male criminal - he never would have received the maximum sentencing. People saying "he would have gone to jail for 40 years" clearly do not spend any time reading the news, because prosecutors almost always ask for maximum sentencing, and rarely do they get it, EVEN FOR MURDERERS. It's highly likely he would have been given little more than parole.
Lastly: Swartz had a history of mental illness and suicidal thoughts - some of it public and irrefutable. He did not commit suicide because he was prosecuted. He committed suicide because he had a history of suicidal thoughts.