Because glass is not a good heat conductor. What it means is that heat isn't transfered through its structure as quickly as it would with metal, for instance. Because heat can't penetrate glass as quickly, the contents stay at the same temperature for longer.