Upvote:3
Spanish citizens do not require a visa to enter Canada for short-term stays, including transit. The only requirement is that you have proof of onward travel (which obviously you will), and sufficient funds for your stay in Canada (which would be $0 given you are only in transit).