An NIE number is needed to:
Any EU citizen intending to live in Spain for more than three months is required to be registered with the Central Register of Foreign Nationals (Registro Central de Extranjeros) at a Foreigners Office (Oficina de Extranjero) or local police station (Policia Nacional) if there is no foreigner's office in the area in which they intend to reside.
This document certifies residence in Spain and includes the holders name, address, nationality, and foreigners tax identification number (Número de Identificación de Extranjero - NIE) along with the date of registration.
If you are planning to move to Spain permanently then you do not need to apply for a separate NIE number as this is now incorporated in the Registration Certificate.