1) The term has always been VERY derogatory. According to most sources, the saying was first used by a journalist named E.K. Hale in a story titled "Pork Barrel," published in 1865 by Frank Leslie's Illustrated Newspaper. In Hale's own words: "When plantation owners rolled out a barrel of salt pork into the slave quarters the desperate slaves engaged in a feeding frenzy to get the best pieces. It was a form of entertainment for heartless slavelords and their guests."
2) An early example of pork-barrel legislation is the Bonus Bill, introduced in 1817, way before the term was used to label it as such. The bill tried to finance highways linking the east and south to the western frontier using the earnings bonus of the Second Bank of the United States. But President James Madison vetoed the bill as unconstitutional.
3) Pork-Barrel legislation was rampant at the turn of the 20th century. I found this amazing statistic in a book published in 1921 called Principles and Problems of Government: "More than 80-percent of the building authorizations by Congress since 1789 have been since 1902. In other words, more than four times as many buildings have been provided for in 17 years under the sway of the pork-barrel system than under 113 years of unsystemic log-rolling."
4) In case you're now wondering about the origins of logrolling, which is basically the pioneers' way of saying quid pro quo, the largely accepted version goes like this: If neighbors had a pantload of timber that needed moving, they worked together rolling the logs out.
5) Pork-barrel legislation made at least one person famous in a good way: James Stewart was largely unknown until Frank Capra's classic 1939 film Mr. Smith Goes to Washington was released. If you haven't seen the movie, I don't want to ruin it for you, but there's a pork-barrel bill in the plot, used to finance an unneeded dam. Good stuff. Be sure to add the Oscar-winning film to your Netflix.