Saying that you love your brothers and friends is part of the etiquette of keeping righteous company, and is a noble and good characteristic.
Telling people that you love them increases the bonds of love and strengthens the ties among Muslims.
It was narrated from Anas ibn Maalik (may Allaah be pleased with him) that a man was with the Prophet (peace and blessings of Allaah be upon him) when another man passed by and he said: O Messenger of Allaah, I love this man. The Prophet (peace and blessings of Allaah be upon him) said to him: “Have you told him?” He said: No. He said: “Tell him.” So he caught up with him and said: I love you for the sake of Allaah. He said: May the one for Whose sake you love me also love you. Narrated by Abu Dawood (no. 5125) and classed as saheeh by al-Nawawi in Riyadh al-Saaliheen (183) and classed as hasan by al-Albaani in Saheeh Abi Dawood. In some reports of the hadeeth it says: “Tell him for it will strengthen the love between you.” Narrated by Ibn Abi’l-Dunya in al-Ikhwaan (69).
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said:
That is because this word will instil love in his heart, because if a person knows that you love him, he will love you, even though hearts may recognize and love one another without actually speaking, as the Prophet (peace and blessings of Allaah be upon him) said: “Souls are like conscripted soldiers; those whom they recognize, they get along with, and those whom they do not recognize, they will not get along with.” But if a person says it with his tongue, this will increase the love in the heart, so you should say: “I love you for the sake of Allaah.” End quote.
Sharh Riyadh al-Saaliheen.
It was narrated that al-Miqdaam ibn Ma’di Yakrib (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “If one of you loves his brother, let him tell him.” Narrated by al-Tirmidhi (2392) and classed as hasan by al-Albaani in al-Silsilah al-Saheehah (417).
It was narrated from ‘Ali ibn al-Husayn ibn ‘Ali ibn Abi Taalib (may Allaah be pleased with him) that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “If one of you loves his brother for the sake of Allaah, let him tell him, for it does good and makes the love last.”
Shaykh al-Albaani said in al-Silsilah al-Saheehah (1199):
It was narrated by Wakee’ in al-Zuhd (2/67/2) with a saheeh isnaad from ‘Ali ibn al-Husayn in a marfoo’ report.
I (al-Albaani) say: ‘Ali ibn al-Husayn is the grandson of ‘Ali ibn Abi Taalib; he is thiqah jaleel (honest and great man) one of the men of the two Shaykhs (al-Bukhaari and Muslim). So it is mursal with a saheeh isnaad.
There is corroborating evidence in the hadeeth of Mujaahid which is also mursal; this was narrated by Ibn Abi’l-Dunya in Kitaab al-Ikhwaan and in al-Fath al-Kabeer (1/67). There is another corroborating report from Yazeed ibn Na’aamah al-Dubbi, which I narrated in the other book (1726). When all the isnaads are taken into account, the hadeeth is hasan, in sha Allaah. End quote.
What is meant here is that it is mustahabb; it is not obligatory.
Al-Manaawi (may Allaah have mercy on him) said:
“Let him tell him that he loves him for the sake of Allaah” means, it is mustahabb for him to tell him, by saying I love you for the sake of Allaah, i.e., not for any other reason such as kindness and so on, because it ensures that the bond will last longer and makes love stronger, and it increases and multiplies love, and brings people together, thus the Muslims will be united, and troubles and grudges will be dispelled. This is one of the good features of Islam.
And Allaah knows best.