Quantum chemical analysis for the formation of glycine in the interstellar medium