Why does iOS 9 have different glyphs for some characters on keyboard vs. on screen?
This problem has existed an every version of iOS until 10 as far as I know, and best I can figure is intentional since it probably would have been fixed by now. It's just more visible with San Francisco. 

I don't know why Apple does it. Could it be that it looks better on the keyboard?

iOS 11 no longer has this behavior as it has added "smart quotes" à la Microsoft Word. Most of the time, as a result, you you will see the character you expected to see typed.