Yes, if you are a non-EU/EEA citizen, you must obtain a work permit to work in Spain. You must apply for a work visa to legally work in the country, whereas EU nationals do not need a work visa to work in Spain; they can reside and work in the country without a work permit or visa.