Amniocentesis is legally banned because it is predominantly used for determining the sex of the fetus, leading to sex-selective abortions.