Hey there, Stacey.
Welcome to the Apple Support Communities! Thanks for posting about the trouble you're having with the App Store function within the Messages app on your iPhone. We'd be glad to see how we can help.
Do apps from the normal App Store install OK? How about other apps from the App Store within Messages? What we're trying to do here is verify if the issue is device wide, or if the issue is only for that one specific app. Also, are you attempting this download while connected to cellular data or Wi-Fi? You may want to try using the other method to see if the results are the same. You may also want to verify that your iPhone has plenty of space free to install that app. How to check the storage on your iPhone, iPad, and iPod touch will walk you through finding out how much free space is present.
Also, if you're using a VPN or network security app, try disabling that and attempting the downloads again. Content restrictions may also be at play, so verify that this isn't the case using the steps in Use parental controls on your child's iPhone, iPad, and iPod touch.
Let us know what you find out.
Be well.