Galactosemia is inherited, which means children get the gene for it from their parents. A child ends up with galactosemia when both parents have a defective d gene and both pass it on to their baby.