It is not a bad thing. Gas is released within the fluid in joints. The fluid is called synovial fluid, your ankles stretch as you walk, releasing this gas and making the snapping sound. In the same way your knuckles would crack if your pulled your fingers.
Cracking does not indicate pathology of your joints in mos cases. However, if you are having pain associated with this, it would be worth while getting an xray and seeing your doctor to evaluate for osteoarthritis.
If your ankles have always done this, then it is nothing to worry about. Some people have joints that naturally crack frequently and cracking is just a sign of dispelling air from between the bones. If they have just started doing this, it might be a sign of tension.
I have had this since I was a little girl, and my Doctor has always said that it is nothing to worry about. My husbands knees often crack as well. If you have pain with it, then you should see your Doctor.