Most modern smartphones have the LCD, digitizer and glass all fused together. It improves image quality and reduces the distance between the glass and the image. This, however, greatly increases the replacement cost since you would then have to replace the entire unit when you break it. Also, higher resolution screens are more expensive.
I think the 3GS is old enough to have these layers as discrete components that you can replace one by one, hence the lower cost.