The general principal in such cases - and even an unbeliever might agree - is that you still can't keep the money, but you should give it to the genuinely needy. William Booth, the founder of the Salvation Army used to say that, if he were handed dirty money, he would wash it and make it clean. In other words, there must never be any suggestion that a thief, prostitute, or similar malefactor can purchase respectability with a donation, nor that the church can be seen to be encouraging ill-gotten gains. Nevertheless, if the sinner's conscience burdened him to give up the money, Booth would see that it was spent on people who really needed it. It is hard to argue with such a position.
Such was the attitude of the Roman church during the Middle Ages - but there was a twist. The church was defined as being "poor", so the alms could legitimately be directed to it. To be sure, the penitent could always give directly to widows, orphans, or other needy persons of his own choice. But it must be admitted, to its credit, that the church was the predominant conduit of charity during that period, so gifts to it had a good chance of ending up in the hands of the indigent. The trouble was, with the church being defined as being poor, as well as helping the poor, it left the opportunity wide open for the funds to be diverted to ecclesiastical purposes.
Where the practice became really corrupt was when the alms to be paid was less than the full amount of the illicit gains ie the sinner was allowed to keep some of it. Any way you look at this, it was a licence to steal, yet for a long time this was a regular custom with the hawkers of indulgences - the "pardoners", as Chaucer, and others, called them. So notorious had become the abuses that, in 1547, faced with criticism from the Reformation, the Roman Church promulgated a ruling against them. Nevertheless, it was never enforced against the Spanish Santa Cruzada, or "holy crusade".
This was the sale of indulgences in Spain, originally in order to finance the crusade against the occupying Muslims. Once Spain had been finally liberated, the funds were redirected to building and maintaining the church, and later for government activities.
These indulgences covered all sins, but with regard to the restitution of ill-gotten gains, we shall go to Henry Lea's comprehensive, three volume tome, A History of Auricular Confession and Indulgences in the Latin Church, published in 1896. Lea was no friend of the unreformed church, but his scholarship was broad and detailed, with multiple footnotes on every page citing the original documents, most commonly in Latin, justifying his position. We can therefore have no doubts as to the accuracy of his work. I shall therefore quote from pages 64 to 66 of volume 2 (which can be read or downloaded here).
As described in an official text-book, issued in 1610, the Commissioner General of the Santa Cruzada issued a long list of the sources of unlawful gains, such as the profits of usury and gambling, of watered wine and short weights and measures, bribery received by judges, extortionate charges by officials, things lost or left on deposit, presents made by men to their mistresses etc. This served as a guide for sinners, who had no reason to complain of the terms offered to them, for the price charged for permission to retain these illicit profits was temptingly moderate - only two reales on sums under 5000 maravedises (about 159 reales or 14 ducats), and at this rate up to 100,000 maravedises, while larger amounts were subject to special bargaining with the Commissioner General, who had full power from the Holy See to settle all cases. In the Indies the terms were higher - five per cent. of the amount compounded for - while no bula de composision was issued at a less price than twelve reales, and, when the sum in question exceeded 800 ducats, a special composition was designated by the Commissioner General. In the Bula, as published annually by that official, he set forth that no one can attain heaven who has not, according to St. Augustin, made restitution of all ill-acquired gains, and as this frequently cannot be done without loss of honor, and it is often troublesome to ascertain the amount and the person to whom restitution is due, it shows the paternal love of the pope for his children that he has thus opened the way, so that now, when the Church is so harassed with the attacks of infidels and heretics, and the Catholic king is its special champion, all doubts can be quieted by paying in aid of his expeditions against these enemies of the Church two reales in composition for 5000 maravedises, and the faithful are invited to compare the smallness of the sum required with the greatness of the release, the object of the pope being to place it within the reach of every one, so that all may join in the great work and not remain in a state of condemnation. [Lea points out that the document was issued in the vernacular, not Latin, for the benefit of the ordinary people.] In process of time the percentage has been raised, while the minimum has been reduced, so that it is brought within reach of the humblest sinners. At present [written in 1896], in modern currency, the bula costs 1 peseta and 15 céntimos, equivalent to about 23 cents of American money, which serves as composition for 14 pesetas and 45 céntimos, or about $2.89, as will be seen by the facsimile while I give of those issued in 1889. [This was printed on page 67. In other words, this "racket" was still going strong just seven years before the book was published.] For larger sums additional bulls are bought, but no one can take more than fifty in any one year, aggregating a composition for 735 pesetas and 29 céntimos, and for greater amounts he must wait until the next year, or apply to the Commissioner General for a special composition. Thus the charge, which in the sixteenth century was only 1⅓ per cent., has been raised to 8 per cent,, while it is understood that the special transactions for larger sums are on a basis of 10 per cent. The bula has a blank left for the name of the sinner, but he is advised that it is injudicious to fill this in, as it would be proclaiming himself a thief; he must take the bull, otherwise he derives no benefit from the payment, but, for the sake of his reputation, his safest course is to destroy it immediately. [Lea cites a document bearing the official approval of the Cardinal Archbishop of Valladolid.] Having done this, he remains, in the words of the bula, free and discharged from the obligation of restitution up to the amount for which he has paid. In all this there is no allusion to contrition or confession - it is a simple matter of trade. As wars with infidels and heretics are no longer in fashion, the proceeds are now applied to the support of the Spanish churches, except the portion which the pope reserves for the Holy See.Such, then, was the situation at the end of the nineteenth century. One assumes that it disappeared during the political upheavals in Spain during the twentieth century, but who knows? I wonder how many Roman Catholics are aware that this sort of chicanery was so recent. As we are now coming up to the 500th anniversary of the Reformation, I shall have more to say about this in my next essay.