The reason we store the password history is so that SF can prevent a user from re-using any of their last X passwords, where X is configured through the SFSPreferences.sp_PwBeforeRepeat field value. It is configured through the security preferences.
So, if you're trying to duplicate that functionality, just set the preference. If you need a user-readable log of the passwords, then you'll have to get it from the EncryptedData class.