The Wikipedia entry on eight as a lucky number has two contradictory explanations:
– It comes from the shape of the kanji for eight broadening at the bottom, signifying prosperity
– The number was used as a general way to say “many”, hence I would imagine also signifying prosperity
It also mentions that in Chinese the sound of the word is the same as the word for prosperity. Although this isn’t true in Japanese, it is quite possible the superstition came from China and then another explanation was made up for it.