There are basically two things that make a job pay well: Rarity of the skill, and complexity of the task. Back in the day, computer programmers were a very obscure and rare trade. Nobody knew much about the arcane inner workings of computers, so the few people who did know something about it were able to extract a good hefty paycheck without having to do anything particularly complex.
However, now there's a flood of people on the market who are reasonably well informed as to how to make a computer do what they want. 100 line C programs can be cranked out by outsourced Chinese workers for pennies on the dollar. You can probably even find a college intern to do it for free if all you want is someone to read a spec, and produce code that works. So, "simple" programming is not well paying anymore.
Now, if you want a career with reasonable pay, you have to start tackling the "complex" tasks. Sure, writing thread locking is fun and all, but nobody really cares how your semaphore code is working, what they care about is whether the website properly shows your profile picture on the next screen after you upload a new one, and that their 600 friends all see the new picture in their stream too within a minute. That's not a "simple problem" so if you want good pay, that's the kind of problem that you're going to be asked to tackle.