What can you do to stop this? Stop rotating that joint.
For most folks, when you "crack" a joint, you're either moving the joint back into or out of its normal position. A thick, clear lubricant that's made mostly of carbon dioxide and some nitrogen called synovial fluid is found between the bones. When you rotate a joint beyond it's normal position, you cause the bones to slightly pull apart. Pressure on the synovial fluid is reduced and bubbles form that quickly expand and then burst - which is why you get that cracking noise.
I can wiggle my fingers and get my knuckle joints to "crack." I'm not concerned about it and kind of find it "fun."