Various foods and drink can influence the state of one’s mind. Onions, garlic, asafoetida (hing), etc, are classified as foods that change one’s mind such that it becomes angry and one cannot control it. Followers of Lord Swaminarayan must avoid any food or drink that does this, because these will not allow the disciple to worship God effectively.
One must ensure that all of one’s senses, including taste, are controlled and kept pure – in order for the mind to be kept pure. Purity of mind, deeds and speech, are how one can please the Lord.
From a social point of view eating strong tasting and strong smelling foods such, as onions and garlic can lead to bodily odours. These are both unsociable and disrespectful to others. Eating onions for example will lead to bad breath. Eating garlic even in small amounts can lead to days of an unsavoury odour coming from the skin. Being in such a state in the presence of the Lord or His sants, is a sign of disrespect towards them. If one wishes to remain close to the Lord forever, they must avoid eating anything that could cause offence to God and His sants.
Onions and garlic fall into this category and offensive foods and are therefore forbidden.
Material from (2 May 2011): http://www.swaminarayangadi.com/baalmandir/faq/q7.php