Carrots are a dense food with many more calories per gram. Green vegs, on the other hand, have more water so it seems (when measuring by volume) carrots might have more sugar. But it is an unfair comparison.
This is why I created a chart to give true comparisons by 10 calorie amounts. This way, the effect of the water weight is neutralized. I did this long ago.
The type of sugar in a carrot is a complex healthier sugar and diabetics can eat them just fine (in reasonable amounts). Not like refined sugars.