As you have gathered the editor is killing your code. There are 2 reasons for this -
- If you insert code it is easy to have badly formed code that will break something downstream on the page. Leaving out a single will kill a page.
- For security reasons. You don't want people being able to insert nefarious code from the editor. In general, it's a good idea to clean any input from a user to prevent all kinds of attacks.
It is recommended that you use a plugin for this type of thing because it gives you more control over the users input. It guarantees that the code used to embed the video will be correct every time and that no additional code is being inserted since all of the heavy lifting is handled by the plugin. The additional processing time of a well written plugin is minimal and you will not see any noticeable difference in site performance unless your site gets millions of page views.
If you really want to do it through the editor, there is a trick to it. Not only do you have to insert the code in the HTML view of the editor, but you have to save the article while still in the code view. The HTML view state of the editor is usually persistent so you need to be sure you are in HTML view before you go back in to an article that you have inserted code in, otherwise simply opening the article will mess up the code you inserted.
Last, there are some extensions that allow you to insert code directly in to the editor. I am not a fan of those because they do pose a security risk.