I disagree. You evidently live in a country where there is not a strong traditional culture of foraging for food. Also, as has been mentioned, just because something is illegal where you live does not make it so elsewhere: you’re making assumptions that absolutely do not apply in other parts of the world.
I also hear people argue that one should not collect wild mushrooms because one might have an effect on the wild populations.
I disagree with this as well. In many cases, foraging is more sustainable than the known damage caused in the cultivation of those same species. This is so particulary of saprobic taxa.
That is not to say that specific taxa (especially mycorrhizal ones) have not been overcollected to the point of virtual extiction and are deserving of legal protection, which is a whole separate issue, and in my mind a more useful discussion to have.