So Blizzard created an online store which allows you to legally download games from their site. You do not need to purchase anything
. You only need to enter your CD-Key into there site (A CD-Key only works once on their site), then your account can legally download the game.
Steps to Download Diablo II:
1) Go over to http://www.blizzard.com/store/
2) Create an account and verify it, if you do not have one.
3) When your logged in, hit the Account link in the top-right.
4) There should be four tabs on the right side, click the one that says Games.
5) You should now be at, https://www.blizzard.com/account/management/games.xml
6) Click Add New Game
7) Add your Diablo II CD-Key in the input box provided.
8) Repeat Step 6 and 7 for your Expansion CD-Key.
9) Now in your Games page, you should see Diablo II and Diablo II: Lord of Destruction.
10) Download the two downloaders (Choosing Mac or Windows).
11) Open up the classic D2 Installer, and choose a location for download.
12) Once completed, install it.
13) Repeat 11-12 for expansion.
Note: You are given a new rendered 26 character cd-key from the site that you must use for the installation. I assume you can use cd-key changer afterwards to change it.