What causes a baby to get tetralogy of fallot?

We don't know. In most cases tetralogy of fallot is thought to be "multifactorial", meaning that there are possibly genes, and also environmental factors which might increase a child's potential of having the defect.
Multiple factors. It is still unclear what causes tof. There are both genetic and environmental factors that appear to increase the risk: poor maternal nutrition; alcohol consumption; maternal age > 40; maternal diabetes; maternal rubella; genetic disorders/syndromes (down syndrome or digeorge syndrome); parent or previous child with tof; maternal pku; maternal use of fluconazole, tegretol, or dilantin.