Upvote:0
Yes, you can enter any Schengen country. I've done a similar thing before, using Schengen visa issued by Italy to enter France (not Spain, but it shouldn't matter).
In the unlikely event you're questioned, you should have a plausible (and perhaps documented) story about Italy being your primary destination.