That's in your day to day diet, not during exercise. Obviously an excess intake of sugar over time is going to have negative effect
What we're discussing here is refueling during exercise. When we do intense exercise we get our energy from blood sugar (glucose) which is converted to glycogen. When glycogen levels are depleted we feel tired and the quickest way to top your glycogen level back up is a sugary snack or a sports drink (I mean a propper sports drink, eg lucozade not monster etc)