Diabetics often secrete glucose into the urine. This is not due to any intrinsic defect in the kidney or its function, but relates to the maximum amount of glucose that the kidney can actively reabsorb from the filtrate.
Because (uncontrolled) diabetics often have blood glucose levels higher than unaffected individuals, and because glucose is small enough to pass through the glomerulous and into the nephron, a large amount of glucose can be found in the filtrate. However, the nephron does have transporters to reabsorb glucose in the proximal convoluted tubules. In unaffected persons, these transporters are sufficient to completely capture glucose before it is lost as urine. The high sugar concentrations of diabetics can surpass the capacity of these transporters to rescue ALL of the glucose in the filtrate, thus allowing some to pass into the urine.