To begin with, type 2 diabetes is typically associated with obesity, a main reason for the upward trend in developed countries. Wine drinkers tend to have healthier lifestyles overall so a certain amount of the benefit relates to healthier eating and exercising regularly. However, there seems to be more to it than that, and now we have biochemical evidence to back us up. One way that diabetes drugs work is to make cells more sensitive to insulin, which in turn helps them take in sugar. (Type 2 diabetics have a problem with insulin sensitivity, not a lack of insulin as in type 1.) Fat cells in particular become resistant to insulin.
Diabetes drugs such as Avandia (rosiglitazone) make cells more responsive to insulin by binding a receptor call PPAR. Red wine contains at least 2 compounds, ellagic acid and epicatechin gallate, that also bind PPAR. On average, a glass of red wine is equivalent (experimentally) to a full dose of Avandia (which by the way cautions against taking it with alcohol.) Other studies have found resveratrol from red wine to have anti-diabetic effects.
Of course anyone on diabetes medication should discuss their alcohol consumption with their doctor, but it helps to be independently informed as well. Alcohol, despite the calories, is metabolized differently from carbohydrates such as sugar; so wine, whose only calories come from alcohol, is less likely to cause problems with blood sugar levels.