This is an advice of the Prophet (sws) to his companion Ali (rta) in his capacity as elder of the society and not in his capacity as a Prophet. This has no religious bearing since there is no ethical principle involved here and such advice falls in the same capacity the way Prophet advised Muslims to turn off their lamps before sleeping, to not let kids go out at or after Maghrib time, to cover all the utensils and other medicinal advice of the Prophet (sws) most commonly known as Tibb-e-Nabwi (sws) etc etc.
Following response covers this issue in more detail:
Discussion 74712 • Reply 74832
It must also be pointed out that in another variant of this narration, the narrator said about the primary narrator of this hadith who is common in both the narrations that He (عَاصِمِ بْنِ كُلَيْبٍ) did not remember which of the two (fingers) Abi Barda (rta) pointed out:
لَمْ يَدْرِ عَاصِمٌ فِي أَىِّ الثِّنْتَيْنِ
(Source: https://sunnah.com/muslim:2078d)
The reason as to why Prophet (sws) forbade it is not known to anyone with certainty but the reasoning mentioned by Imam Nawawi in his famous Sharah of Sahih Muslim seems appropriate:
وَأَجْمَعَ الْمُسْلِمُونَ عَلَى أَنَّ السُّنَّةَ جَعْلُ خَاتَمِ الرَّجُلِ فِي الْخِنْصَرِ وَأَمَّا الْمَرْأَةُ فَإِنَّهَا تَتَّخِذُ خَوَاتِيمَ فِي أَصَابِعَ قَالُوا وَالْحِكْمَةُ فِي كَوْنِهِ فِي الْخِنْصَرِ أَنَّهُ أَبْعَدُ مِنَ الِامْتِهَانِ فِيمَا يتعاطى باليد لكونه طرفا ولأنه لايشغل الْيَدَ عَمَّا تَتَنَاوَلُهُ مِنْ أَشْغَالِهَا بِخِلَافِ غَيْرِ الْخِنْصَرِ وَيُكْرَهُ لِلرَّجُلِ جَعْلُهُ فِي الْوُسْطَى وَالَّتِي تَلِيهَا لِهَذَا الْحَدِيثِ
“There is a consensus among the Muslims that it is recommended for men to wear the ring on the little finger of the left hand. As for women, they are permitted to wear rings on all their fingers. They said that the wisdom behind this ruling is that, unlike the index finger, the little finger is farther from filths that could be touched by the hand and it also does not hinder the hand from doing or catching something And it is makrooh (light reprehensibility) for a man to place it in the middle finger and the finger next to it as per this Hadith”.
(Sharh al-Nawawi ala Sahih Muslim – 14/71)