First-principles calculations are used in order to investigate phonon anomalies in non-magnetic and magnetic Heusler alloys. Phonon dispersions for several systems in their cubic L21 structure were obtained along the [110] direction. We consider compounds which exhibit phonon instabilities and compare them with their stable counterparts. The analysis of the electronic structure allows us to identify the characteristic features leading to structural instabilities. The phonon dispersions of the unstable compounds show that, while the acoustic modes tend to soften, the optical modes disperse in a way which is significantly different from that of the stable structures. The optical modes that appear to disperse at anomalously low frequencies are Raman active, which is considered an indication of a stronger polarizability of the unstable systems. We show that phonon instability of the TA2 mode in Heusler alloys is driven by interaction(repulsion) with the low energy optical vibrations. The optical modes show their unusual behavior due to covalent interactions which are additional bonding features incommensurate with the dominating metallicity in Heusler compounds.