How can we reconcile between the idea of competing in doing good and loving good for others?
Question

How can we reconcile between the hadith of the Messenger of Allah (blessings and peace of Allah be upon him), “No one of you truly believes until he loves for his brother what he loves for himself,” and the words of Allah, may He be exalted (interpretation of the meaning): “So for this let the competitors compete” [al-Mutaffifeen 83:26]?
Praise be to Allah.Firstly:
Part of the practice of the Muslim that Allah, may He be exalted, and His Messenger taught him is the importance of brotherhood among the believers, as Allah, may He be glorified, says (interpretation of the meaning): “The believers are but brothers” [al-Hujuraat 49:10].
There is no contradiction between the verse (interpretation of the meaning) “So for this let the competitors compete” [al-Mutaffifeen 83:26] and what is proven from the Prophet (blessings and peace of Allah be upon him), that he said: “No one of you truly believes until he loves for his brother – or for his neighbour – what he loves for himself.” Narrated by al-Bukhaari (13) and Muslim (45).
The scholars have several views with regard to dispelling this apparent contradiction:
1- That the hadith has to do with matters of this world and the verse has to do with matters of the hereafter. See: Saheeh Muslim bi Sharh al-Abi wa’s-Sanoosi (1/244).
2- It was said that what is meant by that is loving good in general terms, but not in a specific or detailed way such as a person may seek for himself. Ibn al-Jawzi (may Allah be pleased with him) said: If it is said: How can this be imagined when everyone wants to be ahead of others with regard to what he chooses for himself, and he loves to surpass others in virtues, and ‘Umar competed with Abu Bakr? The answer is: that what is meant is to wish for good for them in general terms and wish that evil be warded off from them in general terms. The individual should love that for his brother as he loves it for himself. As for excelling in some specific virtue and attaining a high level of some specific characteristic, there is nothing wrong with the individual wanting to surpass others in that regard.
End quote from Kashf al-Mushkil min Hadith as-Saheehayn (3/222). See also: al-Qabas Sharh al-Muwatta’ by Ibn al-‘Arabi (929) and al-Masaalik Sharh al-Muwatta’ (6/406-417).
3- This is a command to compete in doing more acts of worship, which will prompt others to join him and compete in doing good and righteous deeds. However, the hadith is general in meaning and includes matters of both this world and the hereafter. Hence the believer does not dislike others to join him in that; rather he loves for all people to join him in that competition and urges them to do so. This is a sign that he is very sincere towards people of faith.
Ibn Rajab said in Jaami‘ al-‘Uloom wa’l-Hikam (1/327-335):
The point is that this is one of the characteristics of faith that one is obliged to have: the individual should love for his believing brother what he loves for himself, and hate for him what he hates for himself. If he fails to attain that, then his faith is undermined.
All of this can only be achieved if one’s heart is sound and free of rancour, insincerity and envy, for envy makes the envier hate to see anyone excel him in any good characteristic, or even equal him in it, because he wants to stand out among the people in his virtues, and be distinct from them. But faith requires the opposite of that, which is that all believers should share in what Allah has granted him of good, without that detracting from what he has.
In general, the believer should love for the believers what he loves for himself, and hate for them what he hates for himself. If he sees any shortcoming in his brother in terms of religious commitment, he should strive to advise him.
Nevertheless, the believer should feel sad if he misses out on any religious virtue. Therefore he is instructed, with regard to issues of religious commitment, to look at those who are above him and to strive to compete in increasing in that as much as he can, as Allah, may He be exalted, says (interpretation of the meaning):  “So for this let the competitors compete” [al-Mutaffifeen 83:26]. He should not resent it if anyone shares his virtues with him; rather he should like all people to compete in that, and should urge them to do so. This is a sign that he has attained perfect sincerity towards his brothers.
Al-Fudayl said: If you love for people to be like you, then you are not being sincere towards your brother. So how about if you want them to be inferior to you in that regard?
This indicates that being sincere towards all believers means that you like them to be better than you. This is a high level and lofty degree of sincerity, but that is not obligatory. Rather what is enjoined in Islamic teachings is that you should love for them to be like you, yet if someone surpasses you in some religious virtue, you should strive to catch up with him and feel sad for falling short or falling behind those who have surpassed you – not out of envy for what Allah, may He be glorified and exalted, has given them by His grace , but because you are competing with them, and because you wish to attain what they have attained, without any ill-feeling towards them, and because you feel sad because of your falling behind and failing to attain the same level as those who have surpassed you.
The believer should always think of himself as falling short and not attaining high ranks. He will benefit from that in two important ways: striving to attain those virtues and increase in that, and regarding himself with dissatisfaction. That will result in him loving for the believers to be better than him, because he does not want them to be just like him. He will also be discontent with himself as he is, and will strive to better himself. Muhammad ibn Waasi‘ said to his son: As for your father, may Allah not increase his ilk among the Muslims.
If someone is not content with himself as he is, how can he wish for the Muslims to be like him, if he is sincere towards them? Rather he should love for the Muslims to be better than him, and he should love for himself to be better than he is.
End quote. See also: Fath al-Baari by Ibn Rajab (1/45).
See also the answer to question no. 305135 .
And Allah knows best.