D40 owner here. Its such a good camera for being so crippled. The lens issue is important. The biggest limitation to the D40\D60 is the3 point auto focus. All you get are the three points arranged horizontally in your viewfinder. This means if you subject doesn't fall along that line you have to focus & recompose (or on some lenses just grab to focus ring which is a little better). It's particularly bad in low light.
The other major limitation of the D40 is the lack of a secondary knob on the front. This makes shooting in the P,S,A, or M modes a bit of a chore as you have to hold down buttons to make adjustments to your settings.
Some other things the entry level cameras lack: Exposure Bracketing, Auto-Focus Fine Tuning, Dedicated ISO & WB buttons (you can set one of these to a custom button on the front left of your camera), commander mode for off camera flash, CMOS sensor (better high ISO performance & picture controls).
Here's the thing, you don't need any of this stuff to make great pictures. Most of these features never existed until 20 years ago, and we have a rich history of photography going back decades before that. But for bad photographers like me, all of these things help me make better shots.
If I were recomending a camera to somebody today, it would be the D40 for casual users or the D90 for people looking to get serious about their photography. I'd never recommend the D300\D700\or D3 because anybody who can make use of those cameras wouldn't be asking me in the first place.