The hadith already mentions the reason. Because they had been ungrateful, apostatized from Islam, mutilated and killed an innocent person and then took property (camels) by force. All of these are punishable.
The cutting of hands and feet is claimed by some to have been done in Qisas (retaliation), because there are some reports that these people had done the same to shepherd when they had murdered him.
وإنما قطع رسول الله - صلى الله عليه وسلم - أيديهم وأرجلهم لأنهم فعلوا كذلك بالراعي؛ على ما حكاه أهل التاريخ والسير
The Messenger of Allah ﵌ had their hands and feet cut because they had done the same to the shepherd as reported by the people of history
— al-Mufhim lima Ashkala min Talkhees Muslim
The other explanation is that it was done because one of their crime was Hirabah (banditry), and its Hadd punishment is mentioned in the Quran:
إنما جزاء الذين يحاربون الله ورسوله ويسعون في الأرض فسادا أن يقتلوا أو يصلبوا أو تقطع أيديهم وأرجلهم من خلاف أو ينفوا من الأرض ذلك لهم خزي في الدنيا ولهم في الآخرة عذاب عظيم
Indeed, the penalty for those who wage war against Allah and His Messenger and strive upon earth [to cause] corruption is none but that they be killed or crucified or that their hands and feet be cut off from opposite sides or that they be exiled from the land. That is for them a disgrace in this world; and for them in the Hereafter is a great punishment,
— Quran 5:33
Jurists have different interpretations on how the choice is made between these punishments according to the specifics of the robbery. Because robbery can sometimes involve merely terrorizing people, sometimes it involves murder, sometimes it involves snatching property, and sometimes it involves a combination of these acts.
According to a group including the Hanafis, if a robber both takes property and kills someone then the caliph has the option to amputate their alternate limbs and then to execute or crucify them. Similarly it is noted that if the robber only take property without murdering then the caliph has the option to amputate their limbs alone.
Amputation of limbs is linked to snatching property. This is similar to amputation in the hadd for theft, except that in theft wealth is taken in secrecy while in robbery it is taken openly by use of force.
As for piercing or branding of the eyes then it is stated in some reports that it was in Qisas because they had done this to the shepherd:
عن أنس، قال إنما سمل النبي صلى الله عليه وسلم أعين أولئك لأنهم سملوا أعين الرعاء
Anas reported that Allah's Messenger (ﷺ) pierced their eyes because they had pierced the eyes of the shepherds.
— Muslim