One of the recurring themes in the teachings of the buddha is the noble eightfold path; the basis for achieving nibbana. Oftentimes the components of it are presented as their "wrong" counterparts, and usually a row of examples is provided for what some instances of those "wrong" counterparts are. I am specifically curious about what kind of practical basis (as many of the teachings have some) the instances of "wrong livelihood" might have, with regard to the historical context of when the teachings were formed.
In DN.10. "Subhasutta—Bhikkhu Sujato" the following phrase can be found: (emphasis mine)
There are some ascetics and brahmins who, while enjoying food given in faith, still earn a living by unworthy branches of knowledge, by wrong livelihood. This includes rites for propitiation, for granting wishes, for ghosts, for the earth, for rain, for property settlement, and for preparing and consecrating house sites, and rites involving rinsing and bathing, and oblations. It also includes administering emetics, purgatives, expectorants, and phlegmagogues; administering ear-oils, eye restoratives, nasal medicine, ointments, and counter-ointments; surgery with needle and scalpel, treating children, prescribing root medicines, and binding on herbs. They refrain from such unworthy branches of knowledge, such wrong livelihood. … This pertains to their ethics.
Some of these are easily explained, such as performing mystical rites for luck and blessing, but the examples of medical practice and administering "...nasal medicine, ointments..." leave me somewhat confused. What could be a historical reason for why these practices are considered "wrong livelihood", and more generally, what is the core traits that define "wrong livelihood"?