That claim is false — and it actually mixes up two separate myths!
The Great Wall of China is not visible from Spain. Spain is roughly 9,000+ km away from China — no artificial structure on Earth is visible from that distance with the naked eye.
You're likely thinking of the popular myth that the Great Wall is "visible from space" or "from the Moon." That's also false:
(it then goes on with a detailed, perfect answer).