Earlier quoted context omitted.
It's not illegal. An EU person needs a legal entity in the EU (it can be either freelancer or a company) and then it's just usual B2B relationship where EU person pays their taxes, insurances etc. in the EU. US company still saves, i.e. instead of paying 200k to a fresh graduate they can pay it to a senior dev in the EU.
The illegal bit isn’t the pay structure but the treatment of a contractor as an employee. Both the European and US laws make this distinction with similar criteria. This is to make sure companies aren’t avoiding their obligations to employees. And just from a moral perspective if you’re expecting someone to act like an employee you should treat them in kind.
What's illegal here exactly?
1. US Business Entity conducts business with EU Business Entity.
2. The person (let's call them a contractor) is employed as a full-time employee for the EU Business Entity. They also function as the owner of the EU Business Entity.
3. US Business Entity, EU Business Entity and the contractor - all pay their respective taxes as required by the laws in their jurisdictions.
This is the very foundation of how consultancies operate, for example:
1. The consultancy is the employer, the consultant the employee.
2. The consultant gets hired out to different clients, to work on different projects.
3. The consultant's salary gets paid by the consultancy, not the client.
4. The client only ever conducts business with the consultancy.