During the war between demons and gods for the divine nectar, one of the demon manage to steal the pot of nectar(amrit). At this crunch time when gods were on the verge of defeat, Lord Vishnu appeared and killed that demon with his divine weapon "Sudrashan Chakra" which cuts his head . But that demon had drank nector and by the time he was killed the nectar had reached till his throat. As the blood drops from his body fell on his ground , at the same place a strange plant grew up, which was a garlic plant. This plant acquired two strange properties. Due to effect of nectar , garlic has a lot of medicinal value and it is considered as very good from health's point of view. On the other hand , due to demonic influence , it has a very negative effect on our psychological health and thought process. This is the reason the use of garlic is prohibited during pooja ceremony due to its negative effect(Taamsik energy) on contrary to pooja which has positive effect(saatwik energy). Still it is believe that a person who ate garlic/onion in previous 6 months before his death does not get salvation!!