Oh goodness, not all maggots are bad now. they are just going through the stage of larvae to butterfly or moth lol. Some maggots are specifically, surgically raised in the labroratory and used to heal wounds, in that they are applied to a wound with rotten flesh, covered with gauze and the maggots will eat all the rotten flesh away and probably save a soldier or somebody's life. This type of treatment is used used today. I would venture to say that the maggots in the fabric came from a moth.
I am also a washer of fabric. It is always a good idea to wash the chemical out of the new fabric. I think it's formeldahide, I use to be very allergic to it. I dont' know if they still use that but they use something. It also saves the fabric from getting rotten (cotten will rot over time) since we keep some fabrics for years, it is a good idea.
Also we handle fabric on a daily basis and we handle whatever chemical is on it and if your hands are getting dry or anything, this is one of the things to consider. My fabric is alway dropped the a basket in the laundry to be washed next wash day or if lot, right then and I hang my fabric outside to dry and the fold and store.