My iPhone 5 gives me the message, "Unable to join the network "Name" " every time I try to join any network - secure or not secure.
You should check with the network admin to make sure you aren't being blocked at the access points. In some places they'ven taken a view that smartphones are too much for their LANs and are actively blocking them.
for basic wifi troubleshooting, Try this:
Retrieving data ...