Don't pack your suitcase without checking the exact expiry date on your passport first. If you renewed it 8 years ago, it's likely running out because Spanish passports are valid for 10 years, so you'd already be near the limit or even past it.
Morocco does require those minimum 6 months of validity from the date you enter the country. It's not that they're especially strict, it's a pretty standard rule in the Maghreb and Middle East. The Moroccan border will let you in if you meet that requirement, but if you don't, they simply won't let you through. It's not a "sometimes yes, sometimes no" kind of thing - it's a fixed rule. Since you're traveling next week, the smartest thing is to call the passport issuing office nearest to you tomorrow (or check your autonomous community's website) to find out how long it takes to renew. In many places nowadays they do it pretty quickly if it's urgent.
If it turns out you still have enough validity, perfect, but don't leave it to chance. Better to go check the document physically than discover the problem when you're already at passport control.