Hadith Where Prophet Burnt The Ants
We know of instances where prophets have shown such emotional responses in the context of a bigger cause (جانب حق). Prophet Suleman (sws) used sword on his horses when he missed his Asr Salah while watching his horses. Similalrly, Prophet Muhammad (sws) had dogs killed in Medina when he consecutively missed several meetings with Angel Gabriel because of the filth caused by those dogs. These emotional responses erupted when they saw an animal causing hindrance towards a bigger cause. These are one off instances and should not be used as a basis for any religious directive. It is possible that there could be a wider context in the case of the Prophet mentioned in this Hadith, which is unfortunately missing. Prophets are human beings with the aim to spread the message of Allah, and in that capacity we should try to understand their emotional responses when someting causes a hindrance in that message or in fulfillment of their duty. Please also note that while Prophets are the most pious people of their times, and they show mercy and soft heartedness wherever possible, but it is not right to say that they forgave their worst enemies all the time. While they may forgive their enemies at a personal level, but they themselves ordered to kill the worst enemies of Islam. Prophet Muhammad (sws) had also ordered several of the people to be killed because of their extreme enmity towards Islam. Showing mercy at every moment is neither possible nor logical. Please also refer to the video below from 1:06:33 to 1:09:22 https://youtu.be/L1WekJ9S9Xs?t=3993