Callum Wyper, seven, was supposed to have received support to manage the condition, including administration of the drug.
North Lanarkshire Council has been criticised by a tribunal for the failure of its staff to ensure he got the injections at Dykehead Primary School in Shotts.
It relied on volunteers from among existing school staff to support pupils with diabetes with their insulin regimes.
However, when the support was withdrawn and no other provision was made, Callum's mother Julie and stepfather James, withdrew him from school so they could safely manage his needs.
The Additional Support Needs Tribunal has criticised the council for failing to provide adequate support for his health care needs.
It said it was reasonable to recruit support staff whose duties included a responsibility for the administration of insulin. It found the council had unlawfully discriminated against Callum in relation to his disability.
The Equality Act 2010 includes a duty on schools to make reasonable adjustments for disabled pupils. Since September 2012, that duty has included a duty to provide auxiliary aids and services, where required.
The test case and is the first to deal with the administration of medicines in school in Scotland.
Mrs Wyper said: "All we wanted is for Callum to have the same chances at school as any other wee boy. We are really pleased the school and the council must take Callum's diabetes seriously."
A spokesman for North Lanarkshire Council said: "We are in the process of studying what is a complex judgment covering a unique set of circumstances."