It is not illegal for insects to be present in mushrooms offered for sale, at least following US and Washington state law. The FDA has regulations regarding food for human consumption, and 21 CFR 112 is relevant to your issue (specifically, produce for human consumption). Insects are covered under the term "pest". You should assume that the insects are naturally occurring, not contaminants arising from processing – if the packager added maggots as part of packaging, that's a contaminant. The manufacturer has a duty to watch for foreseeable hazards, but ants (a frequent traveler with mushrooms) are not hazardous. You could file a complaint with the FDA, if there was an actual hazard and if it was foreseeable. Section 402(a)(3) of the Federal Food, Drug, and Cosmetic Act defines "adulterated" as being food grown, harvested, packed, or held under such conditions that it is unfit for food, or under
Section 402(a)(4) when it has been prepared, packed, or held under insanitary conditions whereby it may have become contaminated with filth, or whereby it may have been rendered injurious to health. The bug most likely was not introduced by unsanitary preparation or storage.
There are some standards for processed mushrooms (dried or canned) in terms of numbers of maggots per gram, but no standards for fresh mushrooms.
There are also regulations allowing unavoidable contaminants and there is a big blank where naturally occurring poisonous or deleterious substances would go – they are unregulated.
Washington law has many regulations regarding animal products, and regulations pertaining to processing methods and the introduction of adulterants, but no laws prohibiting the sale of mushrooms that happen to have bugs.