Suppose to be from the Monty Python 'Spam' sketch - A bunch of Vikings in a cafe ordering food and the waitress saying she had Spam, spam, spam, spam. It turns into an whole sketch of annoying repetitive word association.
An early web community in the early 90's? casually coined and used the term as reference and descriptor to the junk mail. It's as simple as that. ( I think?)