Have you ever had a friend or friendship-group who wanted little to do with you when you were in a bad place, poor or suffering?

Then you became strong/rich/powerful and all of a sudden they thought you were great.

Why are we supposed to detest this in a friend but accept this in (potential) partners? And how are we meant to respect them in regards to this?