In Gadhada Part 1, Chapter 78 of the Vachanamrut, Lord Swaminarayan states that God becomes truly pleased those who flawlessly abide by the five vows (panch vartman).
One of these five vows is to refrain from eating anything that contains, or has been in contact with meat. Jeevanpran Shree Abji Bapashree explains in the Rahasyarth Pradeepka Teeka of this Vachanamrut, that one can only claim to have abided by this vow flawlessly, if they also refrain from consuming unwashed grain, unfiltered water, garlic, onion, asafoetida (hingh), etc. In likening onion and garlic to meat, Jeevanpran Bapashree has highlighted the importance of abstaining from eating these items.
The three qualities of Maya (satva, rajas, and tamas) exist in varying levels within one's mind. Satva are the qualities comprising of tranquillity, restraint, purity and peace of mind. Rajas are the passion and pleasure seeking attributes of Maya. Tamas are the evil qualities that lead one to become angry, resentful, arrogant and destructive. In order to concentrate one's mind on the Lord, the qualities of rajas and tamas must be suppressed, allowing the satvik qualities to prevail.
Various foods and drink can influence the state of one's mind and can therefore manipulate the levels of satva, rajas and tamas. For example, alcohol lowers inhibitions and invokes rajsik qualities such as lust. In the same manner, onions, garlic, asafoetida, etc, raise tamsik qualities such as anger. Disciples of the Lord must avoid any food or drink that are considered rajsik or tamsik because these cause a hindrance in their worship of God.
Whilst rajsik or tamsik qualities are prevalent, one's mind will not remain calm. Therefore, whilst in these states, one cannot meditate on God. When the quality of satva prevails, meditation and faithful worship can be performed. Therefore, a disciple of God must ensure that their mind continually suppresses all rajsik and tamsik natures and establishes the state of satva. 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 the manners through which one can please the Lord.
From a social perspective, the consumption of strong tasting and highly aromatic foods such as onions and garlic can lead to bodily odours, which are both unsociable and disrespectful to others. Eating onions for example will inevitably lead to bad breath. The consumption of garlic, even in minute quantities, can lead to several days of an unsavoury odour being emitted from the pores of the skin. Being in such a malodorous state in the presence of the Lord or His sants, is a sign of disrespect and disregard for them. If one wishes to remain close to the Lord forever, they must avoid anything that could cause offence to God and His sants.
Onions and garlic fall into the category of tamsik and offensive foods and are therefore forbidden.