iPhone connects to public Wi-Fi but Mac doesn't - why?
This could be related to the frequency/band the Wi-Fi is using, maybee this posts can help you:

How can I tell which band (2.4GHz or 5GHz) my iPhone&#39;s WiFi connection is on?

Can Macbook Pro handle 2.4GHz and 5GHz frequencies on the same wifi network without getting dropouts?