That is commonly caused by pelvic imbalance which creates binding of the sacroiliac joints. This lack of normal mobility displaces the synovial fluid in the joint. When you move a certain way, the pressure in the joint is released and the sudden symmetrical disbursement of the synovial fluid creates cavitation, i.e., pop or crack. Also, in pelvic imbalance one leg will become shorter known as an acquired short leg and body weight is dispersed unevenly. This in time can contribute to the formation of a scoliosis. I would advise seeing a chiropractor because this is their realm of expertise.
Yours in health,