1)The separation of the right and the left side of the heart keeps oxygenated and de-oxygenated blood from mixing. This is useful in animals and birds who have high energy needs and constantly use energy to maintain body temperature.  

2)In organisms that do not use energy for this purpose, like amphibians and reptiles, the body temperature depends on the temperature of the environment.  Such animals can some mixing of oxygenated and de-oxygenated blood streams and therefore have three chambered hearts.