Lawyers: Do I really need to explain that they perform an important, valuable role?
Drug dealers: Can't say much here. Drugs are tricky, economists call them inelastic, and they can make people irrational.
Bankers: I sure like being able to invest my money and use it everywhere via EFTPOS
Accountants: It's a hell of a drag doing taxes. It's very valuable to have someone do this work for you (if it wasn't, everyone would do their own accounting).
Bottom line: determining value is a tricky economic/algorithmic question.
Luckily, we have a price system, where people can set prices. If the customers pay that price, that's a strong indicator that the service is worth that much. It's not perfect (see bubbles), but it works pretty well on average.
making self driving vehicles.
creating better battery technology.
figuring out a way to get rid of lawyers.
working on super intelligence.
brain computer interface (the one input mechanism that would do away without keyboards)
augmented reality projection straight to your visual cortex, no more computer monitors would only be the beginning of something like that.
robotics robotics robotics
space exploration
deep sea exploration
longevity research
...
Solving some of the things you mention could produce immense benefits for everybody, but it seems like the common wisdom is that it's too risky to pay people salaries equivalent to "finance/entertainment/social media smart people salaries" to work on them, at least not in the same quantity as those industries hire.
Finance, entertainment, and social media companies are out there digging through resume sites and college campuses, actively looking for smart people to solve problems, because they are really sure they can make enough money to compensate them well for their efforts, and have a lot left over.
I'd love to work on energy generation, space exploration, brain computer interfaces, or longevity, but I expect I'll be working on more mundane problems until my student loans are paid off and my emergency and retirement accounts are back to where they should be, because there's reliable money in mundane problem solving.
Of course, I may not be smart enough to help out on "big problems," or I may not have the right connections, or enough risk tolerance. I still hope to find out one of these days. :)