on a drive without you knowing. It will, by default, install on the C drive, that is the drive that is set as the master on your IDE controller.
You say that you have replaced your 'main' hard drive, and I assume that by this you mean you replaced the master - the one on which the Operating system was on? A hard drive wouldn't 'try' to install an operating system when you try to retrieve software from it.
I suspect that what has happened is that you've installed a drive into a new machine that already had Windows XP installed on it from a previous machine. Unfortunately you can't do that and expect the system to work - the Windows registry on the drive will contain references to the hardware configuration of the previous machine.
To get Windows XP onto the 160Gb drive you must have inserted the installation CD - there's no other way it would install itself.