I had this in various circumstances. It happens when :
A) the cd key is in use by other people or on a blacklist (if it is legal should not happen, but IS possible theoretically)
B) Key is not properly encoded in registry. This happens when you copy your FH dir to new windows installation, without proper 1.4 --> 1.5 patch applied. The key was encrypted since 1.5 !
B is the most likeley. So do a fresh install of BF2 starting from your original disc (or a downloaded dvd from torrent). Enter your legal key. Download and install 1.41 patch, download and install 1.5 patch (which properly encrypts the key in registry).
Should be fixed!