Sugar is not a mineral because it comes from a plant source. In order to be considered a mineral, a substance must be naturally occurring, solid and inorganic.
To qualify as a naturally occurring substance, the mineral must be the result of a geological process. Examples of these include an extreme drop or rise in temperature, excessive pressure over a long duration of time and the mineral's prolonged enclosure within other rock formations. The next prerequisite for a substance to be considered a mineral requires the substance to be a solid within the range of temperatures found on the surface of Earth.
The third requirement is that the substance must be inorganic. In the case of sugar, the crystalline solid is formed from plants, such as sugar cane and beets. The compound that is formed does not fall into the same category as coal, which is sometimes (wrongly) referred to as a mineral. While both are organic in nature, coal is formed through compounding geological processes. The compound of sugar is formed directly from plants.
Along with these standards, minerals are almost always compounds of elements. While they can share the same orderly crystalline structure as sugar, they are chemically formed through Earth's geological processes. Common types of minerals include native elements, sulphides, oxides, carbonates, phosphates, sulphates, halides and silicates.