Cordocentesis is primarily used to diagnose genetic conditions, blood disorders, and infections in the fetus. It can also be used to assess fetal well-being by measuring blood gases and other biochemical parameters. The procedure allows direct access to fetal circulation, making it a valuable tool for detailed prenatal diagnosis.