Hash codes need not be unique, they just need be the same for equivalent objects. For example, what if you had more than 2^32 objects... they can't all be unique with 32-bit hash codes.
For some objects, their hash code could change between editing sessions... it is best to assume they will.
If you need to persist your own unique ID, try using CustomDataContainer.