No, you don’t need and EHIC to travel to Spain. EHIC stands for European Health Insurance Card. If your EHIC is still valid, you can use this in Spain and other EU countries, and Switzerland. If it’s expired, you can apply for a GHIC (Global Health Insurance Card).
These cards entitle you to the same healthcare as locals in their respective countries (so if you’re in Spain, a valid EHIC or GHIC will give you the same treatment as a Spanish citizen).
You can apply for a GHIC on the NHS website. The cards are free, so be wary of any sites that ask for payment.