Why are reed switches made in glass tubes?
Glass is clean, dimensionally stable and very strong, doesn't outgas at the operating pressures in the interior of the capsule, won't react with the fill gas in the capsule, and doesn't soften under soldering temperatures.

Here's a beautiful link.