I had the same problem and after 4 hellish days of messing with router settings, I have finally figured it out, and came back to this thread to share! I searched here (and everywhere else on the internet) yesterday for an answer, but although the information I found led to the fix, nowhere did I find what was, for me, the vital missing piece of information.
I have a factory reconditioned MacBook Pro that I purchased from the Apple site. It came running Snow Leopard, and I upgraded to Lion as part of my ridiculous quest to connect to wifi at home. Turns out Lion wasn't necessary, but nonetheless, I guess it's nice to have the upgrade. I have Uverse internet with AT&T, and we are using the 2Wire router that came with the system. It has worked with our other apple products and pc laptops at default settings no problem. The MacBook wouldn't connect.
I think MacBook likes WPA2-PSK security for some reason. We were set on WEP. So, go to this address - 192.168.1.254
That will take you to the 2Wire settings site. On the tabs across the top, click "Settings." Then click the "LAN" tab. Go down to the subheading "Security." By Authentication Type, drop-down menu to WPA2-PSK (AES). Then go to the bottom of the page and click Save. Now for the small detail no one has mentioned in my four days of searching for an answer. When your Airport recognizes the network and you select it, it will prompt you for a password. It is not the number you were using for your WEP security. For us, that was a 10 digit number called router access address. For WPA2-PSK, the password is the SSID #. I had to reset all the other devices running on the network with the same new password, and now we are all running on the network again. Thank the lord!!! Hope this helps save some poor souls from the hours of frustration I have just been through!