score:2
Per TIMATIC, the database used by airlines, as a Canadian citizen and resident you're only allowed to enter Spain if flying directly from Canada, Bulgaria, Croatia, Cyprus, Ireland, Romania or a Schengen state. That's why you were denied boarding.
As the UK doesn't have an entry ban, you'll be good for the return trip, though if staying overnight, you're supposed to stick to your hotel (self-isolating)