Warner had a sizable lead heading into the closing 1,500-metre race, and his fifth-place finish was good enough to secure the title in the 10-discipline event.
The 24-year-old from London, Ont., finished with 8,282 points. Grenada's Kurt Felix took the silver with 8,070, and England's Ashley Bryant got the bronze with 8,109.
Warner was the bronze medallist at last year's world championships. He hadn't competed yet this season due to a leg injury.
His gold medal was the sixth by a Canadian on Day 6 in Glasgow.
Earlier, swimmer Ryan Cochrane (men's 1,500 metres), women's mountain biker Catharine Pendrel, weightlifter Marie-Ève Beauchemin-Nadeau (women's 75 kg), and wrestlers Erica Wiebe (women's 75 kg) and Korey Jarvis (men's 125 kg) won their events.