I think there's actually a lot of caveats, all jobs are not equal, there isn't perfect information about all available jobs (hence the need for recruiting), etc.
But on the other hand, this 'shortage' is being used as a political tool to depress engineering salaries, even though if you applied the same logic to other professions you would find there are worse shortages there. Clearly it would be useful from a healthcare cost perspective if we had more doctors but we aren't expanding visa quotas there. Salary is a huge issue and most jobs want to pay engineers as little as possible. Of course they will rant about how competitive their pay is but if it was so competitive they would probably advertise it, instead of trying to use information asymmetry so they can negotiate them down lower. Then of course, they only hire the best, but salary negotiations inevitably revert to 'market wages', then after all this they can't hire people so they need more immigrants who get deported if they fire them.
For some reason, if you can't afford an accountant, you don't get an accountant, if you can't afford a private lawyer, you don't get a private lawyer, but if you can't afford a programmer, there is a talent shortage and we need more skilled immigrants and to subsidize more STEM graduates.