Your neck could be cracking because of a buildup of puss bubbles. Just like when you crack your knuckles, you are releasing extra fluid that has caused bubbles in that area.
Because nitrogen flows through your blood it sometimes pools between your joints such as your neck. By twisting your neck it forces the nitrogen out with a pop sound.