The old superstition is that it is to be a gift from another biker.
"Ride Bells
The little iron bell that hangs from a biker's motorcycle is supposed to ward off evil spirits. As the story suggests, these demons exist on all roadways, and when a motorcycle passes by, they grab on to it and begin chipping away at your good luck until finally you have a crash.
The tingling of the bell is said to irritate these demons and prevent them from hitching a ride on your motorcycle.
BTW, the bell only has its power when someone else buys it for you, otherwise it doesn't work at all. Some vendors argue that it actually has half-power if you buy your own, but this is just marketing baloney to get people to buy two."