I thought green tomatoes were not the best thing to eat. Bit like raw potatoes, they are very close cousins.
Because of an alkaloid. Maybe the cooking, or the sugar mollifies it.
They also contain small amounts of solanine, a toxic alkaloid found in potato leaves and other plants in the nightshade family - Wiki