Yes, it must have at least 90 days validity starting from the date of your entry into Schengen. Note that Spain will only accept visa applications accompanied by passports issued within the last ten years.