Pentium-D's are basically dual core Pentium-4's. they are newer and in general perform better than the [older, single core] Pentium-4's.
if specs [besides core #] are the same then they will perform about the same when gaming (since most games are only single-threaded), but for everyday use the Pentium-D is far superior to the Pentium-4.
with a single core CPU (Pentium-4) if you run a CPU-intensive application it pretty much bogs down the computer so much that you can't do anything else on it while it's running. but with a dual core CPU you can run two CPU intensive applications at the same time.
now you know why the Pentium-D is better, but it doesn't stop there. you should be comparing model numbers, not clock speed. there are multiple models of Pentium-D's which run at the same clock speed but do not perform equally. for example a Pentium-D 930, 925, and 830 all run at 3.0GHz. the 925 and 930 are both superior to the 830 due to a faster FSB and larger L2 cache. the 930 adds [VT] virtualization technology, but for regular home PC and gaming use the 930 and 925 perform the same.