Whether it's legal or illegal is almost aside the point, someone can choose between either breaking some arcane, unenforced US law, or potentially spending months/years in some hellhole of a third-world jail or prison while the Embassy slowly negotiates a release. And in some places, that's assuming someone doesn't just "disappear" or get robbed and shot on the spot.
It'd often be better to get fired and federally charged than to risk what your company advocates. In a worst case scenario, at least you know what you're getting, at least you'll have competent legal defense, and at least there will be a high -- virtually unprovable -- standard of evidence required for a federal jury to indict.