TL;DR Testosterone improves pancreatic function in males but causes so much overproduction of insulin in females that it causes beta cell injury, predisposing to type 2 diabetes and, of course, pancreatitis (oxidative injury causes inflammation).
In general, chronically inflamed tissue can teach the immune system how to have an autoimmune disorder.