Loans are debt. They have to be paid back. So yeah, of course how much someone will make after school is relevant here. If doctors in the US didn't make bongo bucks, med school costing 250k+ would be absolutely insane (rather than just moderately insane).
Glassdoor (ugh) estimates base pay at about $160k annually for a general practitioner. You're not getting rich off of that salary, especially not in a HCOLA.
Those teachers and nurses you are referring to should absolutely not be saddled with loans they will never be able to repay, and the situation now, where many of these people will be making large student loan payments into retirement or near death, is unconscionable.
There are much better ways to support people who want to go into these professions than signing them up, many at the age of 17 or 18, for a lifetime of crushing debt.
That is a terrible metric. There are plenty of objectively important professions that require advanced degrees and don't pay well. Teachers, nurses, and yeah doctors. Take a look at how much residents or general practitioners get paid. Sure you could make millions hawking voodoo to Peter Thiel but we've also got a shortage of GPs in the United States.
Profit is the wrong motive for (public) education. I'm sure you were aiming more at the underwater basketweaving crowd but even art plays an important role in society.