This may be because of a restriction setting on your iPad. If this is your own iPad you should be able to go to Settings > Screen Time > Content & Privacy Restrictions. On the next screen if the Content & Privacy Restrictions switch is turned Off you should be able to make an In-app Purchase. If the Content & Privacy Restrictions switch is turned On you will need to tap on iTunes & App Store Purchases > In-app Purchases > Allow.