I have a bit to add to this. That classroom scene is my favourite exposition in all media I've seen or read! It actually explains everything very well, you just have to know it's important. Here's that scene cut down and translated by me.
“Tell me, are demons (妖 Yao), devils (魔 Mo), ghosts (鬼 Gui) and monsters (怪 Guai) all the same thing?”
“Why not? How do you distinguish between them?”
“Demons are transformed from living creatures other than humans. Devils are transformed from living humans. Ghosts are transformed from the dead. Monsters are transformed from inanimate objects other than humans.”
(“妖者非人之活物所化;魔者生人所化;鬼者死者所化;怪者非人之死物所化。”)
“‘Yao’ (妖) and ‘guai’ (怪) are easily confused. Could you give an example to distinguish them?”
[…] “Take, for instance, a living tree that has absorbed overheard knowledge for a hundred years, cultivated itself into a spirit, developed a consciousness, and now haunts and troubles people. That's a ‘demon’ (妖). But if I were to take an axe and chop it down, leaving only a dead stump, and it were to cultivate into a spirit again, that would be a ‘monster’ (怪).”
(“臂如一颗活树,沾染书香之气百年,修炼成精,化出意识,作祟扰人,此为‘妖’。若我拿了一把板斧,拦腰砍断只剩个死树墩儿,它再修炼成精,此为‘怪’。”)
“Let me ask you this: there was once an executioner who had parents, a wife and children, yet beheaded over a hundred people during his lifetime. He met a violent end in the streets, his body left exposed for seven days. His pent-up resentment has led him to haunt and commit atrocities. What should you do?”
Lan Wangji […] said calmly, "Salvation first, suppression second, extermination third. First, appeal to their parents, wife, and children, fulfilling their wishes in life and dispelling their obsessions. If that doesn't work, then suppress them; if their crimes are heinous and their resentment lingers, then eradicate them completely, allowing them no chance of survival. […]"
Wei Wuxian said, "Although 'salvation' is said to be the first priority, 'salvation' is often impossible. 'Fulfilling their wishes in their previous life and dispelling their obsessions' is easier said than done. If these obsessions are a new set of clothes is fine, but what if it means killing an entire family to avenge a wrong?"
Lan Wangji said, "Then, suppression should assist salvation. If necessary, extermination would also follow."
Wei Wuxian smiled slightly and said, "What a waste." […] "This executioner died a violent death, so it's inevitable that he became a fierce corpse. Since he beheaded over a hundred people in his lifetime, why not dig up the graves of those hundred, stir up their resentment, and gather the hundred to fight against the fierce corpse."
Lan Qiren abruptly stood up: "‘Subduing devils and taking down demons, driving out ghosts and destroying malevolent forces (伏魔降妖、除鬼歼邪,) —all this is done for the sake of salvation! Not only do you fail to contemplate the path to salvation, but you even seek to stir up their resentment? You've spit in the face of natural order, disregarding human ethics!"
Wei Wuxian said, "Since some things are useless for salvation anyway, why not make use of them? Even Yu the Great knew that blocking is the worst strategy, while dredging is the best. Suppression is blocking, isn't it a worst strategy." […] "Spiritual energy is energy, and resentment is energy too. Spiritual energy, stored in the dantian, can split mountains and fill seas for human use. Why can't resentment be used for human use?"
[…] "Then let me ask you again! How can you guarantee that this resentment will be used for your own benefit and not to harm others?"
Wei Wuxian […] replied: "I haven't thought of that yet!"
Lan Qiren roared: "If you had, the entire cultivation world would not have allowed you to live. Get out!"
I believe we actually do see Mo several times in the novel! Mostly in the form of qi deviations and use of the Tiger Tally.
走火入魔 is translated as qi deviation, but "being possessed" is more fitting. Modernly it's used as a way to say "to be obsessed", but in the original daoist/buddhist context, it's about focusing on hallucinations that can arise during meditation. It happens due to unhealthily intense focus on sensations, feeling, desires, ect, leading to confusion between illusion and reality. The Nie clan is prone to it because they use sabers that eventually became monsters filled with killing intent. The users become possessed with rage or despair and it eventually kills them.
However, we also see this with WWX too! During the Bloodbath of Nightless City he looses control of corpses and is so overwhelmed with anger mixed with despair he became possessed with his need for revenge. After he looses all control of himself he also looses recollection of what happened and act as if he wasn't consciously there. He's just mindlessly hurting everyone around. An important role in that plays the Tiger Tally which is similar to Nie clan's sabers. Both are filled with and feed off of resentment, but the resentment also infects the user of the weapon. The saberes are cultivated using resentful energy of beasts and creatures they slay, while the Tally was created with the sword from inside the Xuanwu of Slaughter, which was filled with the resentful energy of all the people it ate. The Tally however doesn't form any conciseness or bonds with any user, it's just a tool filled with the overwhelming intent of mindless revenge.
Another thing are the actual Mo cultivators, who use energy of living humans rather than dead like Wei Wuxian does. He understandably doesn't like them, because unlike the ghost path, which requires control over your emotions and compassion, it's done to or with the harm of living humans. He wanted to use the unrest dead to deal with those being that can't be saved, ideally additionally helping the unrest with moving on by using them. In this way even people too weak to form a core can help with night hunts. Instead people who have selfish desires use it to harm others. This is exactly what Lan Qiren feared. Wei Wuxian opened the door to demonic path, whether he wanted or not. He never figured out how to make sure the method is used for good and not to harm others.