Are you signed into the account that was deleted on your device?
If so, you will not be able to log out of your account since the password that is needed is no longer available. You will need to provide the original purchase receipt from Apple or Authorized Apple seller in order to remove the account from your device. This is detailed in the Support Article here:
Make sure that you sign out of all your devices to avoid issues with apps that use your Apple Account or iCloud. After your account is deleted, you can’t sign out of iCloud or turn off Find My iPhone Activation Lock on your devices. If you forget to sign out, you might not be able to use your device when your account is deleted.
How to delete your Apple Account - Apple Support
The message you are seeing asking for your previous password is from an app on your phone that was downloaded with the deleted Apple ID. You will no longer be able to update this app. Deleting the app will prevent it from asking for that password. From the same Support Article above:
When you delete your account, you can’t access any App Store, iTunes Store, or Apple Books services associated with this Apple Account. These services include, but are not limited to:
- Updating purchased apps
- Downloading previously purchased items