One alternative view is that it's good for America to educate the world, give them a positive experience/perspective on the US, then go back to their homelands to improve and run it having said positive American outlook.
Another is that just because you studied here doesn't mean you're actually unique talent -- there are Americans who also need work at the low-to-mid levels whose industries have been displaced and are now jobless.
Obviously there alternative paths to citizenship, and being educated accelerates your prospects. It's not like the H1B or J1 are the only way -- I've known many get the O visa because they actually are unique talent.