Is there more context to this? Like this sounds ridiculous even for the USA. I assume then that he was seeding the articles or otherwise widely distributing them? Not that I think that's worth a death penalty...
The tweet screenshot this post links to has the facts wrong: Swartz was charged and was facing a maximum sentence of 35 years, but had not yet actually been sentenced (or even tried). At the time of his death he had recently rejected a plea bargain offer, and prosecutor Carmen Ortiz (who is absolutely responsible for his death) had just rejected his counter offer.