If you replay the move slowly, you'll see that its the rook that passes through the threat, not the king so the castle is a legal move.