The are quite a few steps and costs involved to import and register and car from a non-EU country in Spain.
First and foremost EU conformity, import and registration costs must be taken into account as these can make the import and registration in Spain impossible or too expensive to be worth while.
This said, under EU rules if you are moving from a non-EU country to live in an EU country, such as Spain, you can bring your possessions including cars, and avoid paying the costly duties and taxes and having to pay for expensive EU conformity certification.
These transfer of residence rules give you up to12 months form the date you get your residency to import your car and avoid paying customs and VAT. However you only have 60 days from the date you take up residency, to register your car and avoid registration tax (if it applies).