The lawsuit refers to the Permanent Labor Certification process - the process of certifying that a position cannot be filled by a US citizen. This is one of the first early steps of an employer sponsoring an employee for a Green Card (so called immigrant visas, not H1-B). In the overwhelming majority of cases this affects people already employed by the company often on non-immigrant visas (such as the H1-B) which it would like to retain. They have already gone through the much demonized H1 visa process.
Onto the process - the "newspaper" reference which some commenters have been hung up on is a DoL requirement. It's literally Facebook going by the book and filling all requirements. Where the lawsuit comes in is that Facebook only followed the DoL requirements and did not advertise positions how they would beyond that.
Additionally the article itself states
> When U.S. workers did apply, the suit said, Facebook hired them into different jobs, reserving the open position for the H-1B worker.
Is this discrimination? Yes. Is there a better pathway to retain foreign employees? Not currently. I'm not a fan of Facebook at all, but they do what they need to to keep talent in a competitive environment.