All I can say is if you are willing to throw out $500+ for a camera and don't do research, then you cannot cry that you got ripped off. Let's face it, the D40 is marketed toward the beginner who might or might not get serious into photography to wet their feet, nothing more, nothing less. By far, it is one of the better selling camera's in the Nikon line.
The average consumer does not research items they purchase. An example is a friend of mine. He purchased a Rebel XTi. Why did he choose the XTi? Because he wanted a camera that "takes nice pictures". He bought the XTi because it was the most popular.
Why is it "the most popular"? Reading this forum, you can see it is popular, but definitely not the "most" popular. It is the most popular because to my friend, it has the most exposure to the consumer market. You see it in magazines, you see it in every store from Walmart to Staples to Target. You see it all over the internet at Amazon and on E-bay. Search for "dSLR" and you would probably get the most hits for the Rebel XTi.
Does my friend know what he wants from a camera? Yes, he wants a camera that "takes a nice picture." He purchased his from an E-bay store for approximately $1000 because it came with several lenses, tripod, 2 camera cases, filters, etc. He called the actual store before buying to talk to someone. They talked him into an extra $500 because they told him that he needed a "digital lens" over the lens that came with the package. Why a "digital lens"? Because a "digital lens" works better, according to the store. So, off to swipe the credit card for a $1500 camera because he wanted to take "nice pictures."
When asked about how the camera does, the response was, "It's great! Everything is automatic, EVERYTHING!"
Indeed, the consumer does NOT do any research. This guy I outlined above spent $1500 on a camera that could have been done with a $200-300 camera. Research? The most people do with researching is to look at reviews online, probably user reviews mostly at sites like Amazon or Walmart. If someone were to look at the D40 over the XTi because of price, I'm sure they will see hundreds of user reviews stating that the D40 "takes great pictures" without understanding that those reviews are probably done with only a kit lens because the average consumer doesn't understand what a "kit lens" even is.