Not many people can play bagpipes, so supply is low. But not many people will pay to hear bagpipes, so demand is low, too. Bagpiping doesn't pay well.
Nearly everyone needs food cooked, so demand is high. But nearly everyone can cook, so supply is high, too. Cooking doesn't pay well.
Not many people can do surgery, so supply is low. Many people need surgery, so demand is high. Surgery pays well.
Supply and demand explains why surgeons make more than teachers, why basketball stars make more than nurses, and why programmers make more than janitors. It isn't about how hard something is or how noble it is. It's just supply and demand.