How can I stop my iPhone from auto deleting app data left and right?
In iOS 11 you can have the system 'offload' rarely-used apps and their associated data.  In prior iOS versions, once an app is deleted all its data is deleted, too.  Now you can change that.

By default, this selection is turned on.  It's very simple to turn it off (and back on, if you want).  You can do this by individual app for the the entire device.  

Source:

Individual App


Go to Settings -&gt; General -&gt; iPhone Storage
Tap the app you want to offload





Tap Offload App and then confirm




Its documents and data will be stored on your device. And, when you reinstall the app, all of the data is automatically restored.

Automatically for the device


Go to Settings -&gt; General -&gt; iPhone Storage
Tap on Enable next to Offload Unused Apps




That's all you need to do.  If you don't want this to be done automatically any more, simple disable the selection.