Long-term, you're probably better off replacing the fan. There are four cases to consider:
- Your fan is full of dust. This will usually make it noisy, and no lubricant will help here, so you're better off just cleaning out the fan and going about your business.
- Your fan has open bearings, and the bearings are dirty. Lubricant may temporarily help with this, but it won't fix things long-term, and will probably make things worse eventually.
- Your fan has open bearings, and they are going bad for some reason other than being dirty. Either they're going out of alignment (which lubricant usually won't help with), they've run dry (which lubricant may help with, but might make things worse for in the long term), or they are damaged some other way (which lubricant won't help with). In all three cases, lubrication may fix things temporarily, but it is liable for a wet non-grease lubricant like WD-40 to eventually cause the second possibility to be the case.
- Your fan has sealed bearings, and they are going bad in some way Most common case is going out of alignment, but other damage is possible. In this case, lubricant won't help, period, because the bearings are sealed (and therefore the lubricant can't get to the parts to be lubricated, and will in the case of a wet lubricant like WD-40 usually result in case 1 happening much more quickly.
In all but the first case (which I'm assuming isn't the case here since you would have easily noticed that before applying the lubricant), the only real fix is to just replace the fan (it's generally easy to find replacement laptop fans online, they're the most common thing to replace other than the hard drive, and they're usually not hugely expensive or hard to replace yourself).
As far as WD-40 potentially being bad for the computer, I doubt it will cause issues directly (other than possibly attracting dust) since it has a reasonably high electrical resistance due to being pretty much pure hydrocarbons, but I can think of two (highly unlikely) ways it might indirectly cause problems:
- The grease that was already in the fan's bearings may be conductive (though this is probably very unlikely), and may be solvated by the WD-40, and run out of the bearings into contact with electrically active components, thus running the risk of a short.
- WD-40 might act as a solvent for the insulative coating on the circuit boards in the system (this is essentially the 'rotting plastic' effect mentioned in one of the comments on the question). Usually this coating is a polyurethane that can be solvated by some particularly aggressive detergents, so I think this is more likely to be possible, but I still wouldn't worry too much about it unless you've also got a metal case or aren't careful about static electricity when working on it with the case open.
Edit based on request for citations.
The stuff at the top isn't anything I can easily cite, given that it's based on my own professional experience working on computers and some (reasonably) common engineering knowledge in the case of cases 2, 3, and 4.
Rough estimates of the composition can be deduced based on the MSDS for it, with basic info easily visible on the Wikipedia page.
The comment on the electrical resistance is based on a school science project one of my friends did years ago that I helped with where he tested the electrical properties of a bunch of different commonly available lubricants. I don't remember the exact values he got for WD-40, but I do recall that it was on par with the plastic insulation on the wire he used as a control to test against (and therefore well within the safety range for the 12V fans that are typically seen in computers).
The bit about the possibility of conductive grease is from that same project, and the bit about WD-40 possibly solvating it is based on the basic properties of nonpolar solvents (WD-40 w is such a solvent, which is most of why it's so good at displacing water).
The bit about the WD-40 possibly solvating the insulative coating on the circuit board is based on the same basic properties of nonpolar solvents, combined with personal experience of having ruined a nice weatherproof jacket when I got motor oil on it by accident (weatherproofing of clothing is usually done via a layer of urethane (which was the case with this jacket) or neoprene).