WordPress automatically adds tags when pasting code, how to stop it?

The only way to keep it the way you paste it is by switching to the HTML tab – this will show you the raw code as you formatted it. Wrapping code in tags is also a good idea because it tells the browser that the code is literally ‘precomposed’, and it therefore won’t render it. In terms of WP actually altering your code it is likely it will change characters such as ‘<‘ for their HTML entity equivalent, meaning browsers will render it as text rather than code.

Why exactly do you want to keep it without the tags? It shouldn’t alter that much.