It probably wants you to update or add a payment method. You may need to do this even for a free app. This document explains how to add a payment method to your Apple Account on a Mac, Apple mobile devices, PC, or online ➔ Add a payment method to your Apple Account - Apple Support
On an iPhone or iPad (note that the details may vary slightly depending upon which iOS version you are running) :
1. Open the Settings app.
2. Tap your name.
3. Tap Media & Purchases (or Payment & Shipping). You might be asked to sign in with your Apple ID.
4. Tap Manage Payments. Depending upon the iOS version you use you might not see this step.
5. Tap Add Payment Method. Enter the new payment method, then tap Done.