While honestly things like that might be shocking to our culture today, and in fact, it was shocking to some back then, things like this were often done out of Faith to show the importance of the Bishropic, to serve as a deterrant for future Bishops, and for the soul of the deceased Bishop.
The Bishopric was seen as such a sacred office - no less, the Bishop of Rome, the first of the Bishops, one of the most influential Bishops, and the Apostolic See going back to Saint Peter and Saint Paul - that to abuse that office for personal gain could be seen as a crime deserving the utmost animosity and hatred. Not that these offices weren't heavily abused at the time.
A similar story happened with Saint Gregory the Great. When he was an abbot in Rome, a monk was caught storing gold. On his deathbed, Saint Gregory took the gold and threw it at him saying "take your money unto perdition" and when he died, they threw the corpse onto manure with the coins. He then ordered several Masses to be said for this monk.
According to Saint Gregory's own words, he did this for several reasons. 1. To show as an example to the monks how unacceptable such greed was for a monk 2. In hopes that the soul of the monk would realize the horrors of his sins and turn to Christ lest he was condemned to eternal fire.
The monk later appeared in a dream to other monks saying that he had escaped his fate in Hades and found Salvation.