The reason for this is that the output isn't written until the command is done. Your "rm" commands aren't being run before or after the ftp command, they are being run during the ftp command. They end first and are therefore written first. If you want the order to be the way you are looking for it, change your script to:
ftp -i server1 <<END1
ftp -i server2 <<END2
However, I don't really suggest doing this. If all you wanted to do was know why it is outputting things in an unexpected order, the reason is stated above.