My baby did the same thing. I asked the doctor and she said "this is baby's way to start to explore the world , so let it be." So I did as the doctor said, but my mom was not very happy at all and she said this is not a good habbit.
But after a while, my baby started to play with other things, he gave up this "bad habbit" himself.