Krishna devotee chef, teacher, author, and TV star Kurma Dasa gets asked this question a lot. Here's his well-considered reply.
One of the most common questions asked to me is this: "Why don't you eat garlic and onions?"
Here's my short answer: As a devotee of Krishna and a practicing Bhakti-yogi, I don't eat garlic and onions because they cannot be offered to Krishna.
Here's my longer answer: You may know that onions and garlic are botanical members of the alliaceous family (alliums) - along with leeks, chives and shallots.
According to Ayurveda, India's classic medical science, foods are grouped into three categories - sattvic, rajasic and tamasic - foods in the modes of goodness, passion and ignorance. Onions and garlic, and the other alliaceous plants are classified as rajasic and tamasic, which means that they increase passion and ignorance.
Those that subscribe to pure brahmana-style cooking of India, including myself, and Vaishnavas - followers of Lord Vishnu, Rama and Krishna - like to only cook with foods from the sattvic category. These foods include fresh fruits, vegetables and herbs, dairy products, grains and legumes, and so on. Specifically, Vaisnavas do not like to cook with rajasic or tamasic foods because they are unfit to offer to the Deity.
Rajasic and tamasic foods are also not used because they are detrimental to meditation and devotions. "Garlic and onions are both rajasic and tamasic, and are forbidden to yogis because they root the consciousness more firmly in the body", says well-known authority on Ayurveda, Dr. Robert E. Svoboda.