If it’s edible, plastic help with preserving the food a bit longer. If it’s wet or moist, the plastic will prevent the product from making a big mess.
You could use paper or cardboard too, and that would be good for the environment but bad for everything else. You could use metal or glass containers too, but that’s really expensive and inconvenient. Plastic is the most appealing option as far as manufacturing, shipping, storage and sales are concerned.
In order to change that, you would need to vote for politicians who make plastic more expensive for the companies.