The content of the template is erased after you save it? It only happens when that specific ad code is present?
There is probably a server rule being triggered. Mod_security is a possibility. Truncated request vars are also typical of suhosin in PHP. You need to contact your host to track this down.