But the two processors are FAR from equal.
Let's just consider the cache for a moment. The Pentium 4 features a 256-bit wide bus to the L1 and L2 cache. The AthlonXP features only a 64-bit wide bus. The Pentium 4 requires several LESS clock cycles needed to access the cache as opposed to the Athlon.
A 400MHz system bus for the Pentium 4, and a 20 stage pipeline. A 266MHz system bus for the AthlonXP and a 12 stage pipeline. All these combine to make BIG differences.
Since cache is silicon real estate, then yes, it would add to the cost of production. However, AMD probably calculated the trade-off and thought it would be better with that much cache. With AMD's exclusive cache scheme, the use of the L1 and L2 caches is quite efficient as you can store the maximum amount to keep the processor fed.
Look at things in a balanced way, and look at the entire package.