Glass is a better material for storing food because it does not react with foods or liquids like plastics do. Glass doesn't have any chemicals that might leach into your food over time, which means that your food will stay fresher longer. Plastic is porous, so things like oils from your hands can easily get into the plastic and contaminate the food inside of it.
However, if you’re not storing the food items in there for a long time and you’re on the go, plastic can be great because it’s not delicate and it’s much cheaper.