I'm fairly certain the crystals are calcium oxalate
....showing crystals of calcium oxalate (black-edged rectangles). These crystals embedded in the cell cytoplasm are known as raphides. Calcium oxalate crystals are common in the stems and leaves of many plants; they have no known metabolic function other than to serve as a means of disposal of excess calcium in the plant. source
Calcium oxalate can form kidney stones!
And, also this...
Garlic can be purple because of two reasons: it is one of the “hardneck” varieties of garlic with purple stripes or because your white garlic reacted with something acidic. Both are safe to eat and can be used in a variety of dishes. source
So I imagine that the purple garlic comes from the variety, and not the crystals
Interesting...I usually buy the purple garlic just because it looks cooler. Now I wanna try getting acid on some white garlic, see if I can make purple garlic!