In this case I wouldn't say it got the joke, but it's just memorised that this popular order of words would be this particular joke. I wonder if you change the order os somehow tweak the joke a bit so it would be something that shouldn't be in the training data?
But it can spell any word. I tested both in text-davinvi-003 and chatGPT, both initially refused to spell the garbage word "khfsihciweb" but after insisting they did it.
It can even invent readings for acronyms that don't exist:
Acronym: CNN
Expand: Convolutional Neural Network
Acronym: PNP
Expand: Plug and Play
Acronym: SHDJ
Expand: Super High-Definition Jukebox
Acronym: HEDUE
Expand: Higher Education Digital User Experience
Acronym: SHADBEESHQEKSIHXHGESLS
Expand: Super Highly Advanced Digitalized Bionic Electronic Exoskeleton Super Human Quality Exoskeleton Kit for Super High-Gravity Environments and Space Living
Explain this: "no pun in ten did"
text-davinci-003: This phrase is a play on words. It is a way of saying that no pun was intended, or that the speaker did not intend to make a joke.
Write letter by letter "no pun in ten did"
text-davinci-003: n o p u n i n t e n d i d