My problem was that Ubuntu kept trying to connect to WLANs that I didn't have the key for, but I was unable to change the "Connect automatically" option for these WLANs. I resolved this by deleting all the WLANs that I didn't have the key for, so that only one WLAN - for which I have the key - showed up in the Wireless list of network connections. Now Ubuntu doesn't try to connect to the foreign networks anymore.
My problem was that Ubuntu kept trying to connect to WLANs that I didn't have the key for, but I was unable to change the "Connect automatically" option for these WLANs. I resolved this by deleting all the WLANs that I didn't have the key for, so that only one WLAN - for which I have the key - showed up in the Wireless list of network connections. Now Ubuntu doesn't try to connect to the foreign networks anymore.