The glass provides safety to the players and helps to limit the playing area, i.e. preventing players from being checked over the boards taking them out of play, which is why it's part of the playing surface. Hypothetically it could just be replaced by extending the boards higher, but then of course you'd have to sacrifice the viewing angles.
The netting, on the other hand, is solely for the safety of the fans and is thus not part of the playing surface.