The pay is usually indicative of employer's ability to find a person with the necessary skillset to do the job and not some abstract "importance to society" value that the job has.
As a German I wonder what the people where thinking programming VWs TDI system to activate emission controls only during testing, was it worth it? Polluting the environment and peoples lungs for a bit of money? It's not like dev jobs are a rarity in Germany. And yes I'm judgemental about this. And don't get me started on the things that are legal and still a detriment to society.
The value is not what we _think_ of it, but what we're willing to pay for it.
And yet, for the past two years, just about every store you'll ever go to has a 'Sorry, we're shortstaffed' sign in the window.
Ben Franklin called money 'coined liberty'; in this day and age it is more 'coined status'. It is a scaling mechanism. Reputation only works if people know you, there are simply too many people to know, so we've replaced reputation with money.
However, in the context of this discussion thread, the word 'value' can be interpreted as "paycheck". Your and my diversions are that, diversions.
Not to kill your point, but those two are dramatically under-valued and under-appreciated jobs in most societies around the world. Every time you use a toilet (other than the one in your home) which is hopefully clean, somebody had cleaned it recently. Imagine they hadn't. You'd have a terrible day. Every time you go grab a good Starbucks coffee. Maybe even sit down in a comfy sofa to be able to enjoy it. Imagine the barista had screwed it up.
Both experiences make a huge difference in people's lives. Hundreds if not thousands a day. Every day. But they are paid crap and talked about in the way you just did. Compare that to a coder churning away meaningless features in some meaningless app. Would I care if the coder wouldn't show up to work for the next 4 weeks with nobody stepping in their place? No. That answer is decisively different for the toilet cleaner and the barista.