Unable to install apps on iPhone, either free or paid
I contacted Apple for support and they were unable to explain why this happened. They suggested three things:

reset network settings, then enter wi-fi settings again: this failed,
install the latest software version (12.4.8): this worked,
restore the iPod to factory settings: I did not try this.

To see if it works, I could either have signed in from the Settings app, which requests the password for my Mac computer, or to sign in from the App Store app.