Mechanism of substitution reaction with no change in stereochemistry
I can explain the reason why the configuration does not change by using neighboring group participation of the hydroxyl group. This is the mechanism that I propose:


The hydroxyl group attacks C-3 and $\ce{I-}$ leaves.
Then $\ce{N3-}$, the nucleophile, attacks C-3.
Since two successive inversions occur at C-3, the net result is retention.




As you can see, the configuration has not changed. 



@bon brought up a point: The formation of a mixture of products when an epoxide opening takes place. If the nucleophile were to attack C-2 instead,



C-3 will still have the S configuration.



As noted by @Jan in the comments, the epoxide intermediate is symmetrical and both epoxide carbons are equivalent. This can be shown by a $C_2$ rotation: