Don't open it from the file manager, it won't let you save it and you'll have to do a work around like the one you're describing.
Instead, find Notepad in the programs under Windows Accessories and R-click it and select more and Run as Administrator.
Then, from Notepad open the hosts file and paste in the links and it'll save nice and clean.
I had the same problem until I realized that I had to go in via Notepad as an administrator.