The Department of Justice (DOJ) is investigating Elon Musk's SpaceX over allegations the company discriminated against non-U.S. citizens in its hiring practices.

The department opened an investigation into SpaceX last June after receiving a complaint from a job applicant who had applied for a position last March. In a legal filing Thursday, the government said the complaint alleges that SpaceX asked about the applicant's citizenship status, "and ultimately failed to hire him for the position because he is not a U.S. citizen or lawful permanent resident."

A rocket blasts off into space.

Image source: Getty Images.

That's only an allegation, but the DOJ says it is having a hard time getting to the bottom of what happened because SpaceX is not cooperating. In the filing, government attorney Lisa Sandoval asked the U.S. District Court for the Central District of California to enforce an order issued by the DOJ's Office of the Chief Administrative Hearing Officer (OCAHO).

"SpaceX has repeatedly refused to obey the lawfully issued subpoena and OCAHO's order to comply with it," Sandoval wrote. "OCAHO thoroughly analyzed and rejected all the arguments SpaceX raised in its petition to modify or revoke the subpoena. Nevertheless, because SpaceX has refused to comply with OCAHO's order, the United States has no alternative but to seek redress from this Court."

Included in the information request was data on the nationality and immigration status of the company's employees. Sandoval wrote that the DOJ was willing to provide additional time for SpaceX to comply, but turned to the courts after being frustrated in its efforts to get the information from the company. 

SpaceX did not respond to CNBC requests for comment.