A federal judge in Maryland found that Elon Musk’s scrutiny of the agency’s data systems appeared to violate federal privacy laws.