The short version of a long, complicated and slightly irrational answer is procedures, call and acuity.
The clinic specialties don't take any or don't take much call, and are compensated less.
Procedural specialties pay better than exclusively cerebral specialties. Maybe they shouldn't, maybe they should, but they do.
Acuity matters. It's really hard to kill someone in a clinic. It's really easy to kill someone in the OR or with anesthetics (see Michael Jackson or Joan Rivers). That comes with stress and in our society, stress comes with money.
At least that's my current theory.
Edit: I was typing on my phone when the other responses above showed up. Apparently we agree here.