Spam (the computing term) has several definitions according to context but they are all derogatory.
History and origin
The term "spam" comes from a Monty Python sketch where patrons order from a menu where nearly every course rattled off contains SPAM, a type of processed meat. At several points, they are interrupted by vikings singing the praise of SPAM. This joke itself is a reference to the exclusion of SPAM from World War II rationing regulations, implying many British citizens likely became sick of eating SPAM.
Spam has been used as the butt of jokes for many years. Comedian Jeff Foxworthy described Spam (the food) as, "Stuff Posing As Meat."
Note that "SPAM" is a registered trademark of a type of processed meat. Lowercase "spam", or "Spam" with the first letter capitalized, is what we use when talking about pointless and/or unwanted text.