When mining a block and directly placing it back after getting it, you can create a ghost block in your inventory. It would disappear when placed, but you can rename it on an anvil and it will become a real block. This is likely caused by the slight lag on most multiplayer servers.
Duplicate of MC-3175, please use the search function to see if your bug has already been submitted. Currently over 57% of tickets are being resolved as duplicate.