There have been reports of the Gamespy servers, being
"buggy" for the last few days. I would try to connect at
different times of the day. Also double check the version,
you try to connect to. This means patch version also.
Another thing to check is ping time. Do a tracert or ping
to the IP you trying to connect to. If your ping is to high,
the server may not let you enter.