I asked this question some years ago when I was in Graduate school for Cyber-Security. I thought the story behind it was amusing to say the least.The actual origin of the term comes from a 1970 Monty Python Flying Circus skit. During the skit, a customer witnessed all of the restaurant’s menu items devolve into SPAM. When the customer asks questions the waitress repeats the word SPAM, in a corner you can hear a group of Vikings singing “SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, Glorious SPAM! Beautifully wonderful SPAM!”, drowning out other conversation, until finally they are asked to shut up.
The exact usage first usage of the word as it relates to internet messages of varying type, such as chat messages, newsgroups, etc, isn’t entirely known. It sort of happened all over the place in a very short period of time. It is, however, well documented that the users in each of these first instances chose the word “spam” referring to the 1970 Monty Python sketch where SPAM singing was drowning out conversation and SPAM itself was unwanted and popping up all over the menu.