Prevent Rich Text editor from removing code tags?
You've probably got "Purify HTML" checked under your Rich Text field's settings and that's stripping code.

You should really only have that checked if you're accepting input from untrusted sources using the Rich Text field on the front-end of your site. Presumably all users using the control panel are trusted enough not to input malicious code into the site.