Seriously.....
The Nikon D40 is a very capable camera. Here's one review for it. Look at the long (26 page) review, especially the comparisons with other DSLR's.
http://www.dpreview.com/reviews/nikond40/
and another:
http://www.kenrockwell.com/nikon/d40.htm
The prices you are finding probably represent different kits, some with the standard 18-55mm lens, some with a cheaper 28-80mm and some that are just body only.
Another factor is that some sellers offer cameras that are not officially imported by Nikon. In the case of these 'grey' market cameras, Nikon will not warranty them, nor will they repair them afterwards, even if you paid.
Here's one very reliable EBay vendor with great prices. Cameta only sells offically imported Nikon products, and offers new cameras as well as dealer demos for excellent prices. I'm linking you to the 'Buy It Now' prices (not auction). As you can see, the D40 with a 18-55mm, bag, & extras start at $469.95. The combinations and prices vary, but all are guaranteed.
http://search.stores.ebay.com/Cameta-Camera_d40_W0QQfcdZ2QQfciZ5QQfclZ4QQfromZR10QQfsnZCametaQ20CameraQQfsooZ1QQfsopZ3QQfsubZ3QQsascsZ2QQsaselZ27280321QQsbrsrtZdQQsofpZ2
Amazon.com has the D40 with 18-55mm lens for $509.94.
http://www.amazon.com/Nikon-Digital-18-55mm-3-5-5-6G-Zoom-Nikkor/dp/B000KJQ1DG/ref=pd_bbs_sr_1/103-2857947-8218246?ie=UTF8&s=electronics&qid=1189487325&sr=8-1
The other possibility for the lower prices you've found may be that the cameras offered are used. I personally just bought a Nikon D50 off of Ebay that was $380, with lens, so I know it's possible.
P.S. Here are some recent shots taken with that 'old, outdated' D50 that has the same resolution as the D40 you're asking about.
http://tinyurl.com/2l7saa
I hope you find this helpful.