Is a NIE Number a legal requirement?
If your planning on Staying or working in Spain for a period of more than 3 Months it is a legal requirement for you TO GET A NIE NUMBER.
From 28 March 2007, a Royal Decree 240/07 requires that all EU citizens planning to reside in Spain for more than 3 months should register in person at the Oficina de Extranjeros in their province of residence or at designated Police stations. When you register, you will be issued with a credit card size Residence Certificate stating your name, address, nationality, NIE number (Número de Identificación Extranjero) and your date of registration as a resident.
After you have been registered as a resident for five years, you can apply for a certificate of permanent residence in Spain. You will be issued with a similar credit card size Residence Certificate, but it will additionally state that you are a permanent resident (residente permanente).
Note: Some people still have an A4 size Residence Certificate rather than the credit card sized one – in these cases there is no requirement to re-apply for a credit card size one unless your circumstances (for example your address) change, or unless you want to.
More details can be found on the website for the Spanish Ministry of the Interior (information is in Spanish).