The correct syntax needs to be this in the InputAutoCfg.ini:
X Axis = hat(0 Left Right)
Y Axis = hat(0 Up Down)
Remove the quotes.
I'm not sure if the instructions in the RetroPie doc are wrong or something has changed recently, but that fix worked for me.