I mean here that money appear only as a mediator of human relationships. While OP focuses on just salaries, the teacher-student and nurse-patient relationships could be established without it.
How was your teacher not being paid to teach?
Not one teacher, but nearly half of them! It was a small university near research institutes. If a scientist won a grant for their research, they were teaching students for free; if they were struggling financially, the university would register them as teachers for courses that have an unpaid teacher. I understand that it's hard for American folks to imagine, but in Eastern Europe such places still exist.
Finally, what makes a teacher more professional than another?
That should be clear for now. Imagine a person who researches group theory and comes to share their knowledge; and a person who just teaches it. Who do you think is more professional?