Fucked up because they give higher-educated people preference, or fucked up because corporations lobby for more H1B workers to depress engineering wages industry wide?
And in this case they're not giving educated people preference. They didn't come here on a rule that says that people with postgraduate degrees get to come to the US. They came here on a student visa because coming here on a student visa is one of the few ways to get in at all, and it just so happens that a student visa can be upgraded to an H1-B later if the student lands a job with a company willing to sponsor them.
I'd recommend reading this flowchart which explains in detail how fucked-up our immigration system is:
https://reason.com/assets/db/07cf533ddb1d06350cf1ddb5942ef5a...
Interestingly enough, it doesn't mention coming here on a student visa and then upgrading to an H1-B; it's basically the only loophole around that depressing flowchart. Vox's slideshow on immigration, though, does link the flowchart and mention student visas are one of the only other ways to get in (the other is a tourist visa, which is useless for immigration because you can't upgrade, and you'll be denied a tourist visa if the US thinks you're interested in immigrating):
https://www.vox.com/cards/immigration-immigrants-reform-us/h...
tl;dr: Immigration reform would be a godsend for restoring some sense of sanity to the system.
At my very first job, nearly all of my coworkers were Indian. As I met more people at work and started adding them on LinkedIn, I noticed one thing in common with all their LinkedIn profiles: they all got their bachelor's in India and their master's in the US.
One day, I was riding either to or from a company lunch with a coworker, and we started talking about our lives. He asks me about my education, and when I told him I only did my undergrad and never went to grad school, he told me that in his case, he had to go to school here as a condition of getting into this country, and since he already had a bachelors in CS, he went for a master's in CS.
This was before I learned how fucked-up our immigration system is. Once I learned that, his words made so much more sense.