Okay, maybe you know this, maybe you don't, but devotees don't eat them. Strange, huh. So why? Well, let me do some explaining. Material nature has these three categories called "modes." Goodness, Passion, and Ignorance. Everything material falls into one of the three. Yes, this includes food.
So in the mode of goodness, we have stuff like veggies, water, milk & mild products, fruits, grains, and the like. These foods are fun to eat and good for you too! They build strong bodies and strong minds.
In the mode of passion, lies foods that are overly spicy or pungent. This is where garlic and onions come in. True, garlic has some great medicinal qualities, and that's all well and good, but regular, non-medicinal consumption of these increases the sex drive (that's why it's in the mode of passion). It also leads to attachment to sense gratification And that's not too conducive to spiritual life. Food in this mode also increase our desire to gain material wealth for our own lust pleasures (heh heh heh). Also not so conducive to spiritual life.
And lastly, in the mode of ignorance (boo-hiss-hiss), we've got vile "food" (using that term very loosely here) like rotting flesh (sometimes it's called meat ... actually, any meat), eggs, intoxicating drugs (yep, caffeine too -- damn the chocolate!!), things that are putrid also fall into this category. Now enter the mushroom -- a fungus. Not unlike athletes foot (yum yum). Foods in this mode are just beat. AVOID THEM!! Why? Well, let's take a look at your typical beer drinkin', steak eatin', good ol' boy American. What is (s)he? Lazy, intellectually dead, nearly insane. Why? Well, due to basing her/his life in the mode of ignorance, that's why. And hey, you are what you eat, right? So just keep out of this area. Bad news.
So onions, garlic, and mushrooms are out. But just as in life, we have material aspects (body, mind, etc), and spiritual aspects (spirit soul), do does this. As devotees, we do everything as an offering to Krishna, God, so the same goes for eating. All that we cook, we cook for and because of God. So if I was cooking something delish for a pal of mine, why would I make her something she didn't like? That would be quite rude. So since we are devotees and are cooking for our Pal, Krishna, it would only make sense to give Him what He will accept, what He likes. Right? And He accepts only things in the mode of goodness. As said before, onions, garlic and mushrooms aren't in the mode of goodness, so we don't offer them. Makes sense.