WD-40 is not bad for cleaning, displacing water, or preventing light rust in some applications. It can be used as a penetrating oil for loosening rusted parts, but there are better products for that use.
It is not a substantial enough lubricant, though there's a segment of people who insist that it can substitute for oil or grease. This is a corner that should not be cut. A good quality lithium grease and good quality light oil should be on-hand in the garage or shop as lubricants. I think part of it is people who don't know any better just grab a can of WD-40 and use it for everything sometimes.
[Don't get me started on key choppers... bad business]