How are you editing the file?
If you are editing it directly at the command line, this would be the expected behavior.
The proper way to edit the file is in the GUI. Go to the Configuration tab, then the File Editor tab, and select an appropriate host name from the list of appliances in the cluster. Below the host name you should see a list of files, select the 'hosts' file. This will display the contents of the file, and is the proper place to do the editing.