Even though the spade finesse is onside, declarer needs to develop an entry to his hand to earn his 3rd spade trick.
After flying with the ace of spades, he carefully extracts the two club exit cards from west and then plays a spade out.
Now the defender makes her best play by sticking declarer in hand with a spade rather than giving up a trick.
Declarer was then able to run all of his tricks forcing west to discard down to an endplay position.