Conjecture here, and a pretty simple one: people like money, power, and status. Lawyers and doctors have tons of money, have power over you (you are alive, you are not in jail, all because of them), and have credentials because they need to pass hard tests. That's easy to like.
By contrast, understanding what some computer people even do is hard for the layman (no obvious power), and until pretty recently computers did not make you a lot of money. We also let pretty much any idiot with a computer write code, it is not a position of status.
Shows like Mr. Robot and Silicon Valley are already starting to show how perception is changing. Nerds still get made fun of, but you can't be laughing too much at filthy rich entrepreneurs or hackers who do whatever they want to drug dealers, the police, etc.