Wirelessly posted (Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3)
Think of it as a test to validate the network connection. By checking for network connectivity the phone will know if you have access to the internet.
Another reason is some WiFi hot spots contain a captive portal. Apple is "calling home" simply to give you the opportunity to authenticate with the captive portal.
A captive portal is simply a splash screen used at some public WiFi spots which allow you to authenticate or simply agree to the terms and conditions. If you do not authenticate with the captive portal, the phone will be unable to access the internet.