Sounds like a copy and paste issue.
Anyway, there is information on how to clean by allowing just certain tags in your written content in tinymce editor.
https://jonathannicol.com/blog/2015/02/19/clean-pasted-text-in-wordpress/
So if you go to disallow the code
tag with this technique. You should be fine enough..