You might recall seeing the left part of this character before. That’s right, it’s 米 (mǐ), “rice”. The original meaning of 糖 was “sweet rice cake”. The right part, 唐, is here because it is pronounced the same as the whole affair: táng. Most of the original meanings of 唐 are obsolete by now, except that for the Tang dynasty.
More photos related to sugar @ Shutterstock.