No, you don't need to be vaccinated to go to Spain unless you're coming from China.
On the Ministry of Health website, travelers arriving in Spain from China should verify that their immunization certificate satisfies the essential standards.
All the COVID-19 travel prohibitions for entering Spain have been eliminated for everyone else, regardless of COVID-19 vaccination status.