I am not sure I would worry much about harassment via Morse code. It wouldn't be a source of new bullying in the way a social media site would be, so I can't imagine how it could make anything worse
I've seen a story of HS kids 'cheating' by having one kid brodacast test answers via tapping their pencil, which worked until the teacher who knew Morse code realized what was going on and put a stop to it.
Morse requires you to know when the tone both starts and stops in order to differentiate a ‘dah’ from a break indicating a new letter or word or even just a ‘dit’.
Tapping a pencil only gives you the start of a tone since the pencil lift is silent. There is no real way to distinguish between a short tone and a pause (letter e) and a long tone (letter t) if you don’t know when the tone ends and a pause begins.
The same trope is shown in movies. You cannot tap Morse code if the recipient cannot hear when the tap ends.
In other words, the receiver has no way of knowing whether you sent an e or t without there being a signal that the pencil has lifted. Note that e or t can be substituted for any other number of paired letters.
The other issue is that it can take weeks of study to even reach a minimal level of fluency in Morse. 5 WPM is the basic metric. You could tap faster with much more practice, but the proctor would almost certainly notice the student furiously tapping patterns onto their desk with their pencil.
To review you need to devote weeks of study to learn an encoding that is poorly suited for the task, and that has a very slow transmission rate so that you can transmit a message that everyone in the room might be able to hear?
It's very hard to decode morse from just "taps". You need to be able to hear two distinct symbols, "dash" (long) and "dot" (short) and the spaces. I remember in school we used to be able to do morse if we could see each other, using one finger for dot and one for dash, but we'd copy by looking at the fingers, not the sound of the taps.
Providing an avenue that students could (and almost certainly would) use to direct slurs at one another, seems like a surefire way to make things worse. I do share your concerns about social media.
Most schools do things like teach a multitude of languages and communication skills that would be useful for encoding harmful intent. Yet, most bullying happens using the native tongue and simplistic messaging. Rare is the student who is bullied via poetry and the five paragraph essay. Rarer yet is the student bullied via Morse code. I would be willing to bet that no child ever has been bullied in a classroom using secret Morse code. Mostly because Morse code cannot be tapped out. Contrary to the movies, you need to know when the tap ends to decode it, so knocking or tapping is not a reliable way to send a message.
Narrowing kids educational resources and knowledge in an attempt to stop bullying is a fools errand.
Who is spending weeks learning and practicing Morse, and also getting their friends to buy-in, just to bully people discreetly?
When I was in school, they'd just come up with agreed upon dog whistles and use them in front of you, directed at you. They'd usually be otherwise innocuous but packed with some alternative meaning only the in-group knew until they told you.
That's a lot less effort than learning an entire communication system.