For some reason not explained by the passage, after Reuben had persuaded the brothers not to kill Joseph but to cast him into a pit, he had needed to leave them temporarily. When he came back he found the pit empty.
The brothers envied Joseph. Why was that? Did they really desire the love of their father which was shown to their younger brother? If that was the case then they would have loved their father in return, but when they hurt him so badly and so unnecessarily, it was obvious that they had no real love for him. Their envy did not stem from a desire to be genuinely loved by their father but because Joseph had something they did not have.
Reuben was grieved and rent his clothes. Our grief which ought genuinely to be felt for others, can find a route back to our own self-interest which is stronger than what we ought to feel. The deepest feelings of the believer ought to be aligned with the values that God gives us, so that we mourn over what he mourns over, and rejoice with what he rejoices in, but sin disorders our hearts.