How can I keep my fan from staying at full speed after replacing the hard drive?

Solution 1:

You should definitely try resetting the SMC, since it's a known fix for fan issues. Here are the instructions: Resetting the System Management Controller.

Solution 2:

Macs Fan Control can set the fan of an iMac (or MacBook, or other hardware) to any speed. The coolest thing that it can also set a fan to sensor-based control depending on your new HDD by reading its S.M.A.R.T. temperature.

This free app is much better and powerful than HDD Fan Control, which is currently deprecated but still costs $35. Macs Fan Control also works under Windows in Boot Camp.