MUDs were named that because the first reminded people of "adventure" or "Dungeons and Dragons" games that involved jointly exploring a cave or dungeon.
Modern successors of the MUD include Ever Quest, World of Warcraft and The Sims Online.
Here we see a thread where MUDders discuss the meaning and origin of the word Spam in 1990.
Another was to "spam the database" by having a program create a huge number of objects, rather then creating them by hand.
And the term was sometimes used to mean simply flooding a chat session with a bunch of text inserted by a program (commonly called a "bot" today) or just by inserting a file instead of your own real time typing output.
Another unconfirmed report from a BBS user claims to have seen it defined as a "Single Post to All Messagebases" though this origin seems highly unlikely in my judgement.
Another report describes indirectly a person simply typing "spam, spam..." in a MUD with a keyboard macro until being thrown off around 1985.