We can say the same thing about K-12 education -- it's just something we choose to fund collectively, because that's the kind of society we want to be.
But also, progressive taxation means that the rich fund it more than the poor. So the general idea is that if law school and medical school are expensive to provide but result in vastly higher salaries, then it gets paid for in the end out of those lawyers' and doctors' taxes. Not the taxes from average Americans.