On Windows, admin users can view saved wifi passwords. I know that by rooting the device, it is possible to view them on Android and iOS, but usually, rooting is simply not an option. So, why don't these systems offer some option, like require to enter phone's pin code or password to view passwords?
People tend to reuse passwords. So if iOS or Android lets someone see your WiFi password, there is a good chance that that person now knows the password for many other situations. That's not a good idea.
Also, these devices are very portable, so they will find their way into other people's home. Imagine that I would like to access your WiFi, and you're Ok with that except that you don't want me to know your WiFi password. So I hand my phone to you so you enter the password, and everything is fine. I have access to the WiFi, but I don't have access to your password.
iOS has a new feature that couldn't possibly work if you could access the WiFi password: If you bring your phone into reach of my network, and you're in my contact list, you can ask for WiFi access, and I press a button on my phone, and you have access. Your phone gets the password, you don't.