I see this argument sometimes and it's annoying because:
1) People phrase it as a question even when they've already made up their mind (whether that's your case or not).
2) It implicitly assumes that humans and algorithms are the same. They are not - humans have rights and free will, algorithms don't. Humans cannot be bought or sold, etc.
To your question:
a) If you're asking whether teachers should get compensated according to how good a job they do, I think so. They are very often undervalued, especially the good ones - but of course that means the job attracts people who do it because they enjoy it (and are therefore more likely to be good at it) rather than those who chose jobs according to money and then do the bare minimum.
b) There's a critical difference - consent. Teachers consented to their knowledge being used by those they taught. I did not consent to my code being used for training LLMs. In fact I purposefully chose a licence (AGPL) which in any common sence interpretation prohibits this used unless the resulting model is licensed under the same license - you can use my work only if you give back. Maybe there's a hole in the law - then it should be closed.
I am now gonna pose a question to you in turn.
Do you think people should be compensated for the full transitive value of their work?