Cats are actually unable to taste sweetness, so it is unlikely the cat is seeking sugar. However, he may have started investigating this out if curiosity, and continued because he noticed that it got a reaction from the humans.
(One of my cats wants to at least have a taste of anything the human is eating, just to find out what it is, and has sometimes decided it is an interesting flavor or texture even though it tastes different to her.)
Or -- pure speculation -- he may be picking up traces of a mouse having been near the sugar...?
Re whether it's safe: Medical science has been moving toward an opinion that sugar in more than minimal quantities is as bad for us as we used to think fats were, and in fact may be the real cause if some of the metabolic illnesses we had been attributing to fats. A cat's metabolism is a bit different, but I don't think it's that different, and "minimal quantities" is much smaller for a much smaller animal. So I think it's probably safer to discourage this new habit.... or at least not reinforce it.