I have owned both in the past and currently have a DS Lite with an R4 so I can offer my opinion. It all depends on what you're looking to get out of it.
# of games available:
Since the DS is backwards compatible, any gameboy game ever made will run on it. This gives the DS the advantage in terms of games to choose from, since you basically have four systems (original gameboy, gameboy color, gameboy advance, and DS) worth of games to choose from.
Graphics:
In this area the PSP wins hands down. PSP graphics are true 3D and are on par with PS2. DS graphics are fine when it comes to 2D, but when it comes to 3D, most games look about as good as the original Quake.
Functionality:
Wi-fi. Yes, both.
Media playback. Yes, PSP out of box, DS with flashcart and 3rd party programs.
Web surfing. PSP yes, DS no.
Custom firmware:
The DS comes out ahead in this area. While custom firmware enhances the abilities of both consoles, putting custom firmware on the PSP is semi-difficult and could cause a bricked unit if not done properly. Custom firmware on the DS comes in the form of flash carts. So putting custom firmware on the DS is literally as easy as putting a cartridge in.
There are several other factors to consider such as size, weight, battery life, and game cost. In my experience, I have found all of these to be negligable.
Again this is just my opinion so feel to disagree. I just hope I was able to help.