It’s a tradeoff between an incredibly user-friendly install experience for non App Store apps, vs a clean uninstall experience.
The OS doesn’t know what files that app created, thus can’t clean them up.
The OS doesn’t know what files that app created, thus can’t clean them up.