foghornl is right, WD-40 is not a lubricant as such. So in that respect it is bad for your gun since you haven't really lubricated it if you only use WD-40.
If you want proof that WD-40 is not a lubricant, take one hinge pin out of a door in your house that is used often. Completely degrease it and the hinge (brake cleaner, etc.), 'lubricate it with WD-40 and replace it. Check it again in several months. You'll stop using WD-40 as a lubricant. It's great for what it was designed to do and has lots of usages, but lubricating guns for storage isn't one of them.