Elon Musk’s electric vehicle company Tesla allowed racial harassment of its Black employees to run rampant at its Fremont, Calif., plant and retaliated against some workers who complained, the federal agency charged with enforcing civil rights laws alleged in a lawsuit Thursday.