Animals crave sugars because of their energy potential and the pleasurable sensation of tasting sweetness. Yet all sugars are not metabolically equivalent, requiring mechanisms to detect and differentiate between chemically similar sweet substances. Insects use a family of ionotropic gustatory receptors to discriminate sugars1, each of which is selectively activated by specific sweet molecules2–6. To gain insight into the molecular basis of sugar selectivity, we determined structures of Gr9, a gustatory receptor from the silkworm Bombyx mori (BmGr9), in the absence and presence of its sole activating ligand, D-fructose. These structures, along with structure-guided mutagenesis and functional assays, illustrate how D-fructose is enveloped by a ligand-binding pocket that precisely matches the overall shape and pattern of chemical groups in D-fructose. However, our computational docking and experimental binding assays revealed that other sugars also bind BmGr9, yet they are unable to activate the receptor. We determined the structure of BmGr9 in complex with one such non-activating sugar, L-sorbose. While both sugars bind a similar position, only D-fructose is capable of engaging a bridge of two conserved aromatic residues that connects the pocket to the pore helix, inducing a conformational change that allows the ion-conducting pore to open. Thus, chemical specificity does not depend solely on the selectivity of the ligand-binding pocket, but it is an emergent property arising from a combination of receptor-ligand interactions and allosteric coupling. Our results support a model whereby coarse receptor tuning is derived from the size and chemical characteristics of the pocket, whereas fine-tuning of receptor activation is achieved through the selective engagement of an allosteric pathway that regulates ion conduction.