The importance of glass enclosure in incandescent bulb is
to preserve and protect the filament from evaporating.
An incandescent bulb typically consists of a glass enclosure containing a tungsten filament. Incandescent light bulbs usually contain a stem or glass mount attached to the bulb's base which allows the electrical contacts to run through the envelope without gas/air leaks. Small wires embedded in the stem support the filament and/or its lead wires. The main reason of having glass enclosure is that it contains either a vacuum or an inert gas to preserve and protect the filament from evaporating. This leads to breaking of filament i.e. circuit breaking.