Instagram password stealer app yanked from App Store and Google Play

Why would a mobile app steal your password? And why would both Apple and Google be OK with that?
Naked Security – Sophos