It's R&D versus labour. You don't want to import labour (e.g. doctors), but you want to import as much R&D personnel as you can get your hands on (this includes other professions such as biologist, physicist, etc).
The idea is that depriving, say, China of doctors doesn't really accomplish anything except generate more sick Chinese people, which doesn't really pose a major strategic advantage to the US. The only incentive to import them is if there is a major shortage locally (and so far there isn't).
On the other hand, depriving China of engineers can give a significant competitive boost to the US. The more researchers and developers you import the higher chance you have that something that would've been invented in a competing country is invented here instead.
Medical and dental wages are high in large part due to licenture, same as lawyers. They all have guilds, where a union also certifies, so they limit supply to the benefit of incumbents and the detriment of potential entrants and clients.
But that's a circular argument. Programmers are in demand and also have wages artificially controlled by manipulating the supply. There's no reason the government - because they are the government - couldn't break the stranglehold of the AMA, it would be at least as much in the public interest as the H1B programme, if not a great deal more so.