Spam only occurs when spammer is able to get your email address. They have a variety of methods for doing this, some legal and some not.
Either way, result is same. You have become a spam victim. The single most important action that you can take to prevent spam from occurring is to keep your email address off of those lists.
There are a number of ways that this can be accomplished, starting with never giving out your address to anyone whom you do not know or are not conducting business with.
You wouldn't broadcast your phone number over internet, so why is your email any different? Be careful when putting your email address into directories or other form of printed lists.
Those directories could end up on internet giving millions of people access to your email.
If, for example, you are a member of your alumni association and they decide to build a webpage with that information, your address has been exposed however unintentionally.
Make sure of privacy practices that are in place with any organization that you give your email address to.
Do not give your email address out willingly over internet. Your email address is often required when purchasing goods.
If you are willing to give them payment information, then you should feel comfortable giving them your email.
However, fact that they will process sale in accordance with law does not mean that they won't sell lists to spammers.
The sale of goods over internet is regulated and enforced much more stringently than address list distribution. Often it is just too difficult to prove.
The site may ask you if they can share your information with their "partners" or "affiliates". These are simply companies to whom they sell information for purpose of advertisement - spammers.
This box is almost always automatically checked for yes, so make sure you uncheck it before submitting your order.